admin@glassfish.java.net

Re: Jersy OSGi issue? Was: Re: dev test for admin cli

From: Ludovic Champenois <ludovic.champenois_at_oracle.com>
Date: Fri, 18 Jun 2010 09:34:34 -0700

On 6/18/10 9:25 AM, Jason Lee wrote:
> I'm no OSGi expert, but it looks like that may be what this is. It
> can't find (Caused by: java.lang.NoClassDefFoundError: Could not
> initialize class javax.ws.rs.core.MediaType at
> org.glassfish.admin.rest.LazyJerseyInit.exposeContext(LazyJerseyInit.java:76)
> a JAX-RS class, which is delivered in jsf311-api.jar in the modules
> directory. It looks to me like the jsr311 bundle exposes the class
> and ther REST module imports it, so I could be off base. The class
> is, though, available in the modules directory, so unless I miss my
> guess, we've got some wires crossed.
>
> I've added Sahoo and Richard to get their takes.

Did you also look at the osgi.bundle file in the REST module?
Since we lazily optionally depends on JAX-RS, we need to declare our
import package there.
I guess we also need to add
com.sun.ws.rs.ext (but it is already there) and its transitive dependencies?



Ludo
>
> On 6/18/10 10:47 AM, Jason Lee wrote:
>> OK. I didn't see this change, and I'm seeing the exception locally
>> too. I'm not sure how this integration got in with no real testing
>> or warning us on the REST team (my guess is we need to visit QL to
>> make sure we're properly covered). I'll try to figure out the
>> exception, then take a look at where REST stands in QL.
>>
>> On 6/18/10 10:17 AM, Jennifer Chou wrote:
>>> No idea if it's related but there was Jersey version update around
>>> 6/17. Original message.....
>>>
>>> Approved. This version contains the fix to the SNAPSHOT dependency
>>> on org.glassfish.common:internal-api.
>>>
>>>
>>> Pavel Bucek wrote:
>>> Hello,
>>>
>>> I want to integrate Jersey 1.3; can you approve this change?
>>>
>>> Index: pom.xml
>>> ===================================================================
>>> --- pom.xml (revision 37863)
>>> +++ pom.xml (working copy)
>>> @@ -149,7 +149,7 @@
>>> <javadb.version>10.5.3.0</javadb.version>
>>> <jaxr.version>JAXR_RA_20091012</jaxr.version>
>>> <weld.version>1.0.1-SP3</weld.version>
>>> - <jersey.version>1.1.5</jersey.version>
>>> + <jersey.version>1.3</jersey.version>
>>> <jbi.version>1.0</jbi.version>
>>> <wsdl4j.version>1.6.2</wsdl4j.version>
>>> <gmbal.version>3.0.0-b023</gmbal.version>
>>>
>>>
>>> Thanks,
>>> Pavel
>>>
>>>
>>> On 6/18/2010 4:08 PM, Jason Lee wrote:
>>>> Looks like Jersey is not in the classpath.
>>>>
>>>> On 6/18/10 10:05 AM, Tom Mueller wrote:
>>>>> Some of the admin-devtests are failing because of the following
>>>>> exception from the REST service:
>>>>>
>>>>> REST: Exception java.lang.NullPointerException at
>>>>> org.glassfish.admin.rest.RestAdapter.service(RestAdapter.java:178)
>>>>> at
>>>>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
>>>>> at
>>>>> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
>>>>> at
>>>>> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
>>>>> at
>>>>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
>>>>> at
>>>>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>>>>> at
>>>>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
>>>>> at
>>>>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>>>>> at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at
>>>>> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
>>>>> at
>>>>> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>>
>>>>> I also have this log message in server.log (I don't know if this
>>>>> is related):
>>>>> [#|2010-06-18T07:50:50.944-0700|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=67;_ThreadName=Thread-1;|Error
>>>>> trying to call org.glassfish.admin.rest.LazyJerseyInit via
>>>>> instrospection:
>>>>> java.lang.reflect.InvocationTargetException
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> org.glassfish.admin.rest.RestAdapter.exposeContext(RestAdapter.java:391)
>>>>> at
>>>>> org.glassfish.admin.rest.RestAdapter.service(RestAdapter.java:175)
>>>>> at
>>>>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
>>>>> at
>>>>> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
>>>>> at
>>>>> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
>>>>> at
>>>>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
>>>>> at
>>>>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
>>>>> at
>>>>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
>>>>> at
>>>>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>>>>> at
>>>>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
>>>>> at
>>>>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>>>>> at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
>>>>> at
>>>>> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
>>>>> at
>>>>> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
>>>>> at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: java.lang.ExceptionInInitializerError
>>>>> at
>>>>> org.glassfish.admin.rest.LazyJerseyInit.exposeContext(LazyJerseyInit.java:76)
>>>>> ... 23 more
>>>>> Caused by: java.lang.RuntimeException:
>>>>> java.lang.ClassNotFoundException:
>>>>> com.sun.ws.rs.ext.RuntimeDelegateImpl
>>>>> at
>>>>> javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
>>>>> at
>>>>> javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
>>>>> at javax.ws.rs.core.MediaType.<clinit>(MediaType.java:44)
>>>>> ... 24 more
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> com.sun.ws.rs.ext.RuntimeDelegateImpl
>>>>> at
>>>>> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
>>>>> at
>>>>> org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
>>>>> at
>>>>> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1685)
>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Class.java:169)
>>>>> at
>>>>> javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62)
>>>>> at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155)
>>>>> at
>>>>> javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105)
>>>>> ... 26 more
>>>>> |#]
>>>>>
>>>>>
>>>>> Any ideas what is causing this?
>>>>
>>>> --
>>>> Jason Lee
>>>> Senior Member of Technical Staff
>>>> GlassFish Administration Console
>>>>
>>>> Oracle Corporation
>>>> Phone +1 405-216-3193
>>>> Bloghttp://blogs.steeplesoft.com
>>>
>>
>>
>> --
>> Jason Lee
>> Senior Member of Technical Staff
>> GlassFish Administration Console
>>
>> Oracle Corporation
>> Phone +1 405-216-3193
>> Bloghttp://blogs.steeplesoft.com
>
>
> --
> Jason Lee
> Senior Member of Technical Staff
> GlassFish Administration Console
>
> Oracle Corporation
> Phone +1 405-216-3193
> Bloghttp://blogs.steeplesoft.com