users@jersey.java.net

[Jersey] Re: [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory not found by com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [48]]

From: Arul Dhesiaseelan <aruld_at_acm.org>
Date: Mon, 11 Feb 2013 14:51:26 -1000

I am able to deploy and run the helloworld-webapp sample that comes with
the Jersey distribution without any problem on GF 3.1.2.2 web-profile
running with JDK 1.7.

All I had to do was to replace the following jars in glassfish/modules with
the ones from Jersey 1.17 glassfish zip. Remember the sample did not have
any jars in its WEB-INF/lib dir.

jackson-core-asl.jar
jackson-xc.jar
jersey-gf-server.jar
jersey-grizzly.jar
jersey-multipart.jar
jackson-jaxrs.jar
jersey-client.jar
jersey-gf-servlet.jar
jersey-json.jar
jettison.jar
jackson-mapper-asl.jar
jersey-core.jar
jersey-gf-statsproviders.jar
jersey-moxy.jar



On Mon, Feb 11, 2013 at 1:53 PM, Kevin Duffey <andjarnic_at_yahoo.com> wrote:

> I thought of this too.. I have tried including the latest jaxb-1.18 jar
> and not including it in my WAR file, in both cases the exception occurs.
> I've tried to find any location I might have jaxb. I've searched in the
> glassfish paths..can't find it. All I have going is JDK and Glassfish.. so
> I am unclear as to where else it may be. I also vaguely remember that
> Glassfish has a way to load apps either via the WAR/WEB-INF/lib path first
> then parent loaders.. or the normal delegation path.. but I can't remember
> where that is. I also didn't change anything.. so not sure how that would
> have got enabled (or disabled) if that is the case.
>
>
>
>
> ------------------------------
> *From:* Arul Dhesiaseelan <aruld_at_acm.org>
> *To:* Kevin Duffey <andjarnic_at_yahoo.com>
> *Cc:* "users_at_jersey.java.net" <users_at_jersey.java.net>
> *Sent:* Monday, February 11, 2013 3:05 PM
> *Subject:* Re: [Jersey] Re: [java.lang.ClassNotFoundException:
> com.sun.xml.internal.bind.v2.ContextFactory not found by
> com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [48]]
>
> It sounds like a classloader issue. JDK 7 includes a newer version of JAXB
> (2.2.4-2 in update13). May be you are having another version of JAXB RI
> lying around. You should ideally remove jaxb-impl* jars from your
> classpath.
>
> Btw, GlassFish 4 requires JDK 1.7, Jersey 2.0 milestone releases support
> JDK 1.6.
>
> -Arul
>
>
> On Mon, Feb 11, 2013 at 12:57 PM, Kevin Duffey <andjarnic_at_yahoo.com>wrote:
>
> Well I am paranoid about this kind of crap.. I don't know if it was
> introduced by me or not. Oddly..I replaced the jersey 1.17 with 1.14 in the
> glassfish modules, and it STILL shows 1.17 deploying. So now, I am
> reinstalling my OS with Ubuntu instead of Linux Mint, and reinstalling
> java, glassfish, mysql, etc to be sure. This will take another day of my
> time to get everything back.. but I want to be sure. I do not want the "it
> works on my computer" syndrome. So I'll try a clean install, and use 1.15
> perhaps. I don't know that 1.17 adds anything that I don't use in 1.15
> anyway, and I am hoping to go to 2.0 when it's final.. although I am not
> sure at this point if 2.0 requires Glassfish 4 and JDK 1.7 or not. I am
> hoping to move to 1.7 in all environments.. as 1.6 is no longer supported
> with updates and 1.8 is due out soon enough.. seems it's about time to
> trust Java 7! ;)
>
>
>
> ------------------------------
> *From:* Cyril Bouteille <cyril_at_RewardsPay.com>
> *To:* users_at_jersey.java.net; Arul Dhesiaseelan <aruld_at_acm.org>
> *Sent:* Monday, February 11, 2013 2:11 PM
> *Subject:* [Jersey] Re: [java.lang.ClassNotFoundException:
> com.sun.xml.internal.bind.v2.ContextFactory not found by
> com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [48]]
>
> Hello, I've been having the exact same issue since I upgraded to Jersey
> 1.17 and deleting osgi-cache dir while GF is down did not help.
> I've not identified any harmful side-effect to my app from this error yet
> either, but it is definitely troubling...
> Cyril
>
> On 02/11/2013 02:05 PM, Arul Dhesiaseelan wrote:
>
> Did you try this as part of your upgrade [1] ?
>
> To be 100 % sure the changes take effect, you might also want to remove
> the felix cache, which is located in glassfish/domains/domain1/osgi-cachedirectory. This directory gets created upon the first start of the
> GlassFish instance.
>
> [1]
> http://jersey.java.net/nonav/documentation/latest/glassfish.html#d4e1967
>
>
> On Mon, Feb 11, 2013 at 10:44 AM, Kevin Duffey <andjarnic_at_yahoo.com>wrote:
>
> Hi all,
>
> I have been digging around the net for this issue.. and from what I can
> tell, it's "fixed" in 1.14 or 1.15. I don't know why or how this is now
> happening. I am using Glassfish 3.1.2.2 on Linux Mint 14 64-bit. I have not
> changed anything that I know of. I grabbed the latest jersey-1.17 bundle
> jar and deleted the glassfish/modules/jerse* (and jettison and jackson*)
> files, unzipped into there, replaced my project libs with the same unzipped
> jars. I build my WAR without the jars in it, since it's part of the
> glassfish classpath. When I deploy, I am getting this exception (I'll paste
> it at the end).
>
> I am running JDK 1.7 (latest as of a couple weeks ago). I don't even know
> if this breaks my app, but thus far it bugs me that it's even showing up. I
> do use json and jaxb within my jersey rest services, so it's got me a
> little spooked that it may break my app. I'll be testing that now, but in
> the mean time.. I was hoping one of you jersey/glassfish deploy experts may
> shed some light on this.
>
> Thanks.
>
>
> Stacktrace:
>
> [#|2013-02-11T12:18:41.087-0800|INFO|glassfish3.1.2|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=169;_ThreadName=Thread-2;|Initiating
> Jersey application, version 'Jersey: 1.17 01/17/2013 03:31 PM'|#]
>
> [#|2013-02-11T12:18:41.199-0800|WARNING|glassfish3.1.2|com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl|_ThreadID=169;_ThreadName=Thread-2;|Provider
> com.sun.xml.internal.bind.v2.ContextFactory not found
> javax.xml.bind.JAXBException: Provider
> com.sun.xml.internal.bind.v2.ContextFactory not found
> - with linked exception:
> [java.lang.ClassNotFoundException:
> com.sun.xml.internal.bind.v2.ContextFactory not found by
> com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [48]]
> 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.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:95)
> at
> com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:96)
> at
> com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
> at
> com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:106)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1331)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:168)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:774)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:770)
> at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:770)
> at
> com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:172)
> at
> com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:134)
> at
> org.glassfish.admin.rest.LazyJerseyInit.exposeContext(LazyJerseyInit.java:146)
> at
> org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:337)
> at
> org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:146)
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.ClassNotFoundException:
> com.sun.xml.internal.bind.v2.ContextFactory not found by
> com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [48]
> 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:356)
> at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:573)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:145)
> ... 36 more
> |#]
>
>
>
> ------------------------------
> *From:* Jeff Adamson <jwa_at_urbancode.com>
> *To:* users_at_jersey.java.net
> *Sent:* Monday, February 11, 2013 7:17 AM
> *Subject:* [Jersey] Can't svn checkout jersey 1.x source
>
> The svn url https://svn.java.net/svn/jersey~svn/trunk is prompting for
> credentials.
> It can be browsed with the
> http://java.net/projects/jersey/sources/svn/show/ but the direct checkout
> url on that page does not work.
>
> Am I missing some sort of read-only credentials?
>
>
> --Jeff
>
>
>
>
>
>
>
>
>
>