users@glassfish.java.net

Re: [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Thu, 27 Sep 2012 17:12:50 +0530

I quickly tried to run the test case attached to the issue [1] I had
referenced in my email below and it is working. I will go ahead and add
it in our regression test suite.

I suggest you download and run it first. You also tell us what you are
doing differently.

Thanks,
Sahoo

On Thursday 27 September 2012 04:59 PM, Sahoo wrote:
> Hi,
>
> Instead of deploying using FileInstall, could you deploy like this:
>
> asadmin deploy --type osgi <your osgi bundle>
>
> That might fix JAXBContext not being able to find
> com.sun.xml.internal.bind.v2.ContextFactory.
>
> I am actually surprised you are facing this issue, because to my
> knowledge, we had fixed this bug by making changes to JAXB as
> described in [1]. I will find more about that issue. What JDK are you
> using?
>
> Thanks,
> Sahoo
>
> [1] http://java.net/jira/browse/GLASSFISH-11748
>
> On Thursday 27 September 2012 02:26 PM, forums_at_java.net wrote:
>> Hi All, I am newbie to both osgi and glashfish. I have downloaded the
>> latest
>> glashfish 3.1.2.2. and writen a sample osgi bundle. I am getting the
>> following error while creating JAXBContext instance in the server:
>> java.lang.ClassNotFoundException:
>> com.sun.xml.internal.bind.v2.ContextFactory
>> not found by ] at
>> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:148) at
>> javax.xml.bind.ContextFinder.find(ContextFinder.java:361) at
>> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446) at
>> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409) at
>> com.cultagent.gr.hotelde.Activator.start(Activator.java:34) at
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
>>
>> at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977) at
>> org.apache.felix.framework.Felix.startBundle(Felix.java:1895) at
>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
>>
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
>>
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
>>
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
>>
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
>>
>> Caused by: java.lang.ClassNotFoundException:
>> com.sun.xml.internal.bind.v2.ContextFactory not found by
>> com.cultagent.gr.hotelde [265] at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
>>
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
>>
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
>>
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
>> javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:573) at
>> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:145) ...
>> 13 more
>> can any body please suggest me how to resolve this issue. Thanks in
>> advance.
>> Regards, Siva Ram.
>>
>> --
>>
>> [Message sent by forum member 'sivaram']
>>
>> View Post: http://forums.java.net/node/890740
>>
>>
>