Re: Duplicate class definition
Jeroen Frijters <[email protected]> Sat, 14 Nov 2015 14:06:20 +0000
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <[email protected]> |
There is no easy answer, but here are some suggestions:
1) Instead of having core.dll and app.dll, compile everything into a single dll
2) Compile core.dll and app.dll together (using ikvmc { } feature)
3) Compile using the -static ikvmc option and look for the warning that explains why PageantConnector$User32 can't be compiled, then solve that)
Regards,
Jeroen
> -----Original Message-----
> From: Yves Langisch [mailto:[email protected]]
> Sent: Saturday, November 14, 2015 12:25
> To: Jeroen Frijters <[email protected]>
> Cc: ikvm-developers <[email protected]>
> Subject: Re: [Ikvm-developers] Duplicate class definition
>
> Thanks Jeroen.
>
> What do you mean by 'restructure your ikvmc compilation to make the
> class compile statically'?
>
> Best,
> Yves
>
> > On 13 Nov 2015, at 21:43 , Jeroen Frijters <[email protected]> wrote:
> >
> > Hi,
> >
> > This looks like an IKVM bug. I think there is a race condition in the
> class loader for this specific scenario (dynamically loading a class
> that ikvmc was unable to compile statically).
> >
> > I'll fix this, but in the mean time you can try to restructure your
> ikvmc compilation to make the class compile statically, or add some code
> to force the class to be loaded predictably.
> >
> > Thanks for reporting this.
> >
> > Regards,
> > Jeroen
> > ________________________________________
> > From: Yves Langisch <[email protected]>
> > Sent: Friday, November 13, 2015 3:20 PM
> > To: ikvm-developers
> > Subject: [Ikvm-developers] Duplicate class definition
> >
> > Hi there,
> >
> > Sometimes during authentication in my application I get the following
> exception:
> >
> > Caused by: java.util.concurrent.ExecutionException:
> java.lang.LinkageError: duplicate class definition:
> com.jcraft.jsch.agentproxy.connector.PageantConnector$User32
> > at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> > at java.util.concurrent.FutureTask.get(FutureTask.java:192)
> > ...
> > Caused by: java.lang.LinkageError: duplicate class definition:
> com.jcraft.jsch.agentproxy.connector.PageantConnector$User32
> > at Java_java_lang_ClassLoader.defineClass1(Unknown Source)
> > at IKVM.Internal.AssemblyClassLoader.DefineDynamic(Unknown
> Source)
> > at IKVM.Internal.AssemblyClassLoader.LoadDynamic(Unknown
> Source)
> > at IKVM.Internal.AssemblyClassLoader.LoadClassImpl(Unknown
> Source)
> > at IKVM.Internal.ClassLoaderWrapper.LoadClass(Unknown Source)
> > at IKVM.Runtime.ByteCodeHelper.LoadTypeWrapper(Unknown Source)
> > at
> IKVM.Runtime.ByteCodeHelper.DynamicLoadMethodHandleImpl(Unknown Source)
> > at
> IKVM.Runtime.ByteCodeHelper.DynamicBinderMemberLookup(Unknown Source)
> > at
> com.jcraft.jsch.agentproxy.connector.PageantConnector.<init>(PageantConn
> ector.java:57)
> > ...
> >
> > Background:
> >
> > * two relevant DLLs (app.dll, core.ll)
> > * core.dll is an IKVM converted library containing many 3rd party Java
> > jars
> > * app.dll is converted with /reference:core.dll and contains most of
> > the jars in core.dll already (and some more) -> conversion leads to
> > duplicate class warnings
> >
> > As far as I can see there are no duplicate classes in both DLLs.
> Referring to the stack trace, PageantConnector is in core.dll, the
> User32 interface in app.dll, if this makes any difference.
> >
> > Any ideas? Thanks!
> >
> > -
> > Yves
> >
> > ----------------------------------------------------------------------
> > -------- _______________________________________________
> > Ikvm-developers mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/ikvm-developers
------------------------------------------------------------------------------