|
|
|
|
|
|
|
|
|
|
Re: (no subject) [message #693936 is a reply to message #693927] |
Thu, 07 July 2011 14:04 |
Michael Gerzabek Messages: 16 Registered: June 2011 |
Junior Member |
|
|
This is interesting!
I tried three different calls, only the first of them works:
JAXBContext jaxbContext = JAXBContext.newInstance(
"org.jessas.annotator.jaxb.moxy",
Customer.class.getClassLoader());
These two
JAXBContext jaxbContext = JAXBContext.newInstance(
Customer.class, Address.class, PhoneNumber.class);
JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] {
Customer.class, Address.class, PhoneNumber.class },
Collections.<String, Object> emptyMap());
both result in
javax.xml.bind.JAXBException
- with linked exception:
[java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:330)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
at org.jessas.annotator.jaxb.Activator.doit(Activator.java:77)
at org.jessas.annotator.jaxb.Activator.start(Activator.java:33)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jaxb.JAXBContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:129)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:480)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:184)
... 18 more
Anyway. I see how easy it is to use moxy and am happy to provide the ClassLoader by hand. This way I can use it in my bundle an proceed with my requirements.
Thank you for your kind support.
Regards,
Michael
|
|
|
|
Powered by
FUDForum. Page generated in 0.04558 seconds