Re: [Ikvm-developers] Could not instantiate JAXBContext when using with IKVM
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2015-05-11 13:10:29
|
Hi Vadim, This is typically caused by class loader issues. IKVM has no gloabl CLASSPATH setting like Java, so it has to derive the equivalent the main application. However, this means that if your main application dynamically loads your DLL it won’t be able to resolve classes in it via the application class loader. The easiest workaround is to explictly add your DLL to the bootstrap class loader: ikvm.runtime.Startup.addBootClassPathAssembly(typeof(SomeTypeInYourAssembly).Assembly); Regards, Jeroen From: Vadim Bauer [mailto:bau...@gm...] Sent: Monday, May 11, 2015 14:53 To: ikv...@li... Subject: [Ikvm-developers] Could not instantiate JAXBContext when using with IKVM Hello, I have a situation where I get a avax.xml.bind.JAXBException : Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "myContextPath" enthält ObjectFactory.class oder jaxb.index nicht. If I use the my converted DLL inside a application(console) App.exe ---> myJarDLL then jaxb context can be created and the context path is found. Everything is fine. Now I have created some business logic in C# that uses functionality of the jardll. In the end I have this constellation: App.exe ---> BusinessDLL -->myJarDLL This is also working fine: The final situation is actually this: (Windows Service)DLL --> BusinessDLL --> myJarDLL. And this is the point where I get this exception. The next step I did was to create a NUnit testcase that tested myJarDLL NUnit --> myJarDLL. Also at this point I got an javax.xml.bind.JAXBException. This means for me that I can not use myJarDLL inside an another DLL. That only thing that is working is app.exe --> myJarDLL. Do you know why the context path is not found when I myJarDLL is used inside a dll? Context: The arrow (-->) means referencing here. ikvm Version 8.0.5449.1 best regards, v. |