PubSub example on JBoss

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

PubSub example on JBoss

Luca Merolla
This post was updated on .
Hi there,

I'm trying to run the example atmosphere-pubsub on JBoss-5.1.0GA.
It deploys fine but when I try to access the URL I get this message:

01:53:40,087 SEVERE [Atmosphere]
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
        at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
        at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:152)
        at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:89)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:456)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
        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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
....

Is there any library missing from the example WAR file? Shouldn't those classes (sun.com.xml...) belong to the JAXB library?

Thanks in advance,
Luca
Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

jfarcand-2
Salut,

On 10-01-27 8:58 PM, Luca Merolla wrote:

>
> Hi there,
>
> I'm trying to run the example atmosphere-pubsub on JBoss-5.1.0GA.
> It deploys fine but when I try to access the URL I get this message:
>
> 01:53:40,087 SEVERE [Atmosphere]
> java.lang.NoClassDefFoundError: Could not initialize class
> com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
>          at
> com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
>          at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
>          at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
>          at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:152)
>          at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:89)
>          at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:456)
>          at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
>          at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>          at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>          at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>          at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
>          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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
> ....
>
> Is there any library missing from the example WAR file? Should those classes
> (sun.com.xml...) belongs to JAXB?

Can you try removing the jaxb jars under WEB-INF/lib and see if that
help? For a second test, can you remove the atmosphere-jboss-compat.jar
file from WEB-INF/lib and see if that help?

I will take a look as soon as I can.

A+

- Jeanfrancois


>
> Thannks in advance,
> Luca
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

Paul Sandoz
In reply to this post by Luca Merolla
Hi Luca,

I think it is a problem with the version of JAXB distributed with  
JBoss and the version of JAXB distributed in the war file.

You could try modifying the pom file and set the JAXB dependency to  
provided.

Or configuring using JBoss specific stuff that jars in the war take  
precedence.

Paul.

On Jan 28, 2010, at 2:58 AM, Luca Merolla wrote:

>
> Hi there,
>
> I'm trying to run the example atmosphere-pubsub on JBoss-5.1.0GA.
> It deploys fine but when I try to access the URL I get this message:
>
> 01:53:40,087 SEVERE [Atmosphere]
> java.lang.NoClassDefFoundError: Could not initialize class
> com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
>        at
> com
> .sun
> .xml
> .bind
> .v2
> .model
> .impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
>        at
> com
> .sun
> .xml
> .bind
> .v2
> .model
> .impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:
> 129)
>        at
> com
> .sun
> .xml
> .bind
> .v2
> .model
> .impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:
> 81)
>        at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:
> 152)
>        at
> com
> .sun
> .xml
> .bind
> .v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:89)
>        at
> com
> .sun
> .xml
> .bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:
> 456)
>        at
> com
> .sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:
> 302)
>        at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl
> $JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
> 154)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
> 121)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
> 202)
>        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  
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
> ....
>
> Is there any library missing from the example WAR file? Should those  
> classes
> (sun.com.xml...) belongs to JAXB?
>
> Thannks in advance,
> Luca
>
> --
> View this message in context: http://n2.nabble.com/PubSub-example-on-JBoss-tp4471090p4471090.html
> Sent from the Atmosphere users mailling list mailing list archive at  
> Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

Luca Merolla
In reply to this post by jfarcand-2
Hi Jeanfrancois,

I'll try removing the JAXB jars as soon as I'll get home. I was trying already to remove the atmosphere-jboss-compat.jar but that was not helping at that time.

Cheers,
Luca

Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

jfarcand-2
Salut,

On 10-01-28 10:31 AM, Luca Merolla wrote:
>
> Hi Jeanfrancois,
>
> I'll try removing the JAXB jars as soon as I'll get home. I was trying
> already to remove the atmosphere-jboss-compat.jar but that was not helping
> at that time.

Remove it and also remove META-INF/context.xml to see if that help. Paul
recommendation may also work. Let us know what you get so we can
properly fix or document the issue.

Thanks!!

-- Jeanfrancois

>
> Cheers,
> Luca
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

Luca Merolla
In reply to this post by Paul Sandoz
Hi guys,

I have made a step forward... a small one probably, but still better than nothing...

Here it is a list of changes from the original example distributed:

- no context.xml
- removed the following jars:

atmosphere-compat-jbossweb-0.5.jar
jaxb-api-2.1.jar
jaxb-impl-2.1.12.jar
jsr311-api-1.1.1.jar
servlet-api-2.3.jar

Now the error that I get is this one:

javax.servlet.ServletException: No AtmosphereHandler maps request for /*
        org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:200)
        org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:140)
        org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:117)
        org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:86)
        org.atmosphere.cpr.AtmosphereServlet.doCometSupport(AtmosphereServlet.java:778)
        org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:761)
        org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:748)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

By the way, including the "atmosphere-compat-jbossweb-0.5.jar" library or not doesn't seems to have any effect so far.

Am I missing some configuration files?

Thanks in advance,
Luca
Reply | Threaded
Open this post in threaded view
|

Re: PubSub example on JBoss

jfarcand-2
Salut,

On 10-01-28 6:12 PM, Luca Merolla wrote:

>
> Hi guys,
>
> I have made a step forward... a small one probably, but still better than
> nothing...
>
> To summarize the changes from the original example distributed, here are the
> changes:
>
> - no context.xml
> - removed the following jars:
>
> atmosphere-compat-jbossweb-0.5.jar
> jaxb-api-2.1.jar
> jaxb-impl-2.1.12.jar
> jsr311-api-1.1.1.jar
> servlet-api-2.3.jar
>
> Now the error that I get is this one:
>
> javax.servlet.ServletException: No AtmosphereHandler maps request for /*
>
> org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:200)
>
> org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:140)
>
> org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:117)
>
> org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:86)
>
> org.atmosphere.cpr.AtmosphereServlet.doCometSupport(AtmosphereServlet.java:778)
> org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:761)
> org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:748)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Hum strange...JBoss Comet is not detected with the above as I do see the
BLockingIOCometSupport. Let me try on my side.

Sorry for the trouble. I did test using JBossWeb assuming it will work
with JBoss :-(

A+

- Jeanfrancois


>
> By the way, including the "atmosphere-compat-jbossweb-0.5.jar" library or
> not doesn't seems to have any effect so far.
>
> Am I missing some configuration files?
>
> Thanks in advance,
> Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

(Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2
Salut,

re-add the jsr311 jar as this is mandatory. Then you will get:

> java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
>         at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:224)
>         at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
>         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
>         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
>         at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:152)
>         at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:89)
>         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:456)
>         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
>         at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
>         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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
>         at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
>         at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:66)

Paul, there is a clash with jaxb jar...I did try to replace jars in
Jboss to use the same version as Jersey without any luck. Is Jersey
deployable on JBoss 5?

To reproduce, remove:

 >> atmosphere-compat-jbossweb-0.5.jar
 >> jaxb-api-2.1.jar
 >> jaxb-impl-2.1.12.jar
 >> servlet-api-2.3.jar

I don't know who is pulling servlet-api.jar in but that's a bug.

- Jeanfrancois




On 10-01-28 8:21 PM, jfarcand wrote:

> Salut,
>
> On 10-01-28 6:12 PM, Luca Merolla wrote:
>>
>> Hi guys,
>>
>> I have made a step forward... a small one probably, but still better than
>> nothing...
>>
>> To summarize the changes from the original example distributed, here are the
>> changes:
>>
>> - no context.xml
>> - removed the following jars:
>>
>> atmosphere-compat-jbossweb-0.5.jar
>> jaxb-api-2.1.jar
>> jaxb-impl-2.1.12.jar
>> jsr311-api-1.1.1.jar
>> servlet-api-2.3.jar
>>
>> Now the error that I get is this one:
>>
>> javax.servlet.ServletException: No AtmosphereHandler maps request for /*
>>
>> org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:200)
>>
>> org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:140)
>>
>> org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:117)
>>
>> org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:86)
>>
>> org.atmosphere.cpr.AtmosphereServlet.doCometSupport(AtmosphereServlet.java:778)
>> org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:761)
>> org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:748)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>
>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
> Hum strange...JBoss Comet is not detected with the above as I do see the
> BLockingIOCometSupport. Let me try on my side.
>
> Sorry for the trouble. I did test using JBossWeb assuming it will work
> with JBoss :-(
>
> A+
>
> - Jeanfrancois
>
>
>>
>> By the way, including the "atmosphere-compat-jbossweb-0.5.jar" library or
>> not doesn't seems to have any effect so far.
>>
>> Am I missing some configuration files?
>>
>> Thanks in advance,
>> Luca
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Paul Sandoz

On Jan 29, 2010, at 3:35 AM, jfarcand wrote:

> Salut,
>
> re-add the jsr311 jar as this is mandatory. Then you will get:
>
>> java.lang.LinkageError: loader constraint violation: when resolving  
>> field "DATETIME" the class loader (instance of org/jboss/
>> classloader/spi/base/BaseClassLoader) of the referring class, javax/
>> xml/datatype/DatatypeConstants, and the class loader (instance of  
>> <bootloader>) for the field's resolved type, javax/xml/namespace/
>> QName, have different Class objects for that type
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2
>> .model
>> .impl
>> .RuntimeBuiltinLeafInfoImpl
>> .<clinit>(RuntimeBuiltinLeafInfoImpl.java:224)
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2
>> .model
>> .impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2
>> .model
>> .impl
>> .RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2
>> .model
>> .impl
>> .RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
>>        at  
>> com
>> .sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:
>> 152)
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:
>> 89)
>>        at  
>> com
>> .sun
>> .xml
>> .bind
>> .v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:456)
>>        at  
>> com
>> .sun
>> .xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
>>        at com.sun.xml.bind.v2.runtime.JAXBContextImpl
>> $JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>>        at  
>> com
>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>> 154)
>>        at  
>> com
>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>> 121)
>>        at  
>> com
>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>> 202)
>>        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  
>> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
>>        at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
>>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>> 372)
>>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>> 337)
>>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>> 244)
>>        at  
>> com
>> .sun
>> .jersey
>> .server
>> .impl
>> .wadl
>> .WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:
>> 66)
>
> Paul, there is a clash with jaxb jar...I did try to replace jars in  
> Jboss to use the same version as Jersey without any luck. Is Jersey  
> deployable on JBoss 5?
>

Yes, and for 1.1.5 i fixed package scanning issues with JBoss 5.x.

It looks like the version of JAXB used by JBoss is lower that the  
version required for Jersey to generate WADL.

It is possible to disable WADL, see:

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/core/ResourceConfig.html 
#FEATURE_DISABLE_WADL

set that property as an init-param in the web.xml to true.

The general issue is that we do not know how to tell JBoss to use a  
different version of JAXB. I found the following in regard to  
overriding jars that may help:

http://markmail.org/message/lxqmdiqnqtir6lwr#query:JBoss 
%20java.lang.LinkageError%3A%20loader%20constraint%20violation%3A
%20when%20resolving%20field%20DATETIME%20the%20class%20loader+page:1+mid:lxqmdiqnqtir6lwr+state:results

Paul.

> To reproduce, remove:
>
> >> atmosphere-compat-jbossweb-0.5.jar
> >> jaxb-api-2.1.jar
> >> jaxb-impl-2.1.12.jar
> >> servlet-api-2.3.jar
>
> I don't know who is pulling servlet-api.jar in but that's a bug.
>

Will mvn:dependency:tree tell you?

Jersey only has a provided dependency on the servlet API.

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2


On 10-01-29 3:11 AM, Paul Sandoz wrote:

>
> On Jan 29, 2010, at 3:35 AM, jfarcand wrote:
>
>> Salut,
>>
>> re-add the jsr311 jar as this is mandatory. Then you will get:
>>
>>> java.lang.LinkageError: loader constraint violation: when resolving
>>> field "DATETIME" the class loader (instance of org/jboss/
>>> classloader/spi/base/BaseClassLoader) of the referring class, javax/
>>> xml/datatype/DatatypeConstants, and the class loader (instance of
>>> <bootloader>) for the field's resolved type, javax/xml/namespace/
>>> QName, have different Class objects for that type
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2
>>> .model
>>> .impl
>>> .RuntimeBuiltinLeafInfoImpl
>>> .<clinit>(RuntimeBuiltinLeafInfoImpl.java:224)
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2
>>> .model
>>> .impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2
>>> .model
>>> .impl
>>> .RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2
>>> .model
>>> .impl
>>> .RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
>>>         at
>>> com
>>> .sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:
>>> 152)
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:
>>> 89)
>>>         at
>>> com
>>> .sun
>>> .xml
>>> .bind
>>> .v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:456)
>>>         at
>>> com
>>> .sun
>>> .xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
>>>         at com.sun.xml.bind.v2.runtime.JAXBContextImpl
>>> $JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>>>         at
>>> com
>>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>>> 154)
>>>         at
>>> com
>>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>>> 121)
>>>         at
>>> com
>>> .sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
>>> 202)
>>>         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
>>> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
>>>         at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
>>>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>>> 372)
>>>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>>> 337)
>>>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:
>>> 244)
>>>         at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .wadl
>>> .WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:
>>> 66)
>>
>> Paul, there is a clash with jaxb jar...I did try to replace jars in
>> Jboss to use the same version as Jersey without any luck. Is Jersey
>> deployable on JBoss 5?
>>
>
> Yes, and for 1.1.5 i fixed package scanning issues with JBoss 5.x.
>
> It looks like the version of JAXB used by JBoss is lower that the
> version required for Jersey to generate WADL.
>
> It is possible to disable WADL, see:
>
>     https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/core/ResourceConfig.html
> #FEATURE_DISABLE_WADL
>
> set that property as an init-param in the web.xml to true.
>
> The general issue is that we do not know how to tell JBoss to use a
> different version of JAXB. I found the following in regard to
> overriding jars that may help:
>
> http://markmail.org/message/lxqmdiqnqtir6lwr#query:JBoss
> %20java.lang.LinkageError%3A%20loader%20constraint%20violation%3A
> %20when%20resolving%20field%20DATETIME%20the%20class%20loader+page:1+mid:lxqmdiqnqtir6lwr+state:results

euh...OK we have some documentation to write as this is quite
complicated to deploy on JBoss 5 :-(


>
> Paul.
>
>> To reproduce, remove:
>>
>>>> atmosphere-compat-jbossweb-0.5.jar
>>>> jaxb-api-2.1.jar
>>>> jaxb-impl-2.1.12.jar
>>>> servlet-api-2.3.jar
>>
>> I don't know who is pulling servlet-api.jar in but that's a bug.
>>
>
> Will mvn:dependency:tree tell you?

common-logging, but we already have the exclusions in pom.xml but that
doesn't seems to work.

-- Jeanfrancois


>
> Jersey only has a provided dependency on the servlet API.
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Luca Merolla
Guys,

I have solved adding a jboss-web.xml file and adding back the jaxb libraries in the war. In that way we are specifying to use the libraries into the WAR instead of the ones supplied by JBossAS.

Here are the steps (might be useful for a future documentation):
1) Modify the web.xml that use the correct schemaLocation

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

2) Remove the context.xml as it was mentioned in another thread (both from WEB-INF and META-INF)
3) Remove the servlet-2.3.jar (that might not be necessary...)
4) Add a jboss-web.xml file in the WEB-INF folder

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"  
     "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"
<jboss-web> 
     <class-loading java2ClassLoadingCompliance="true"> 
         <loader-repository> 
                org.atmosphere:loader=atmosphere-pubsub.war
         </loader-repository> 
     </class-loading> 
</jboss-web> 

Enjoy it

Cheers,
Luca
Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Paul Sandoz
In reply to this post by jfarcand-2
On Jan 29, 2010, at 11:07 PM, jfarcand wrote:

The general issue is that we do not know how to tell JBoss to use a
different version of JAXB. I found the following in regard to
overriding jars that may help:

http://markmail.org/message/lxqmdiqnqtir6lwr#query:JBoss
%20java.lang.LinkageError%3A%20loader%20constraint%20violation%3A
%20when%20resolving%20field%20DATETIME%20the%20class%20loader+page:1+<a href="mid:lxqmdiqnqtir6lwr+state:results">mid:lxqmdiqnqtir6lwr+state:results

euh...OK we have some documentation to write as this is quite complicated to deploy on JBoss 5 :-(


Yes. This is really frustrating. In general app server docs tend to do a really really bad job of informing developers how to upgrade certain components. Plus the fact that Java is currently lacking a default modularity concept (i know OSGi can solve this) we end up in the 7th layer of classpath hell.

Just wait until JBoss bundles RESTEasy :-)

I can take responsibility for Jersey on GF v2.x and v3. We will add such information to the Jersey user guide and you can link to that.

Paul.
Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2
In reply to this post by Luca Merolla
Salut,

On 10-01-30 12:16 PM, Luca Merolla wrote:

>
> Guys,
>
> I have solved adding a jboss-web.xml file and adding back the jaxb libraries
> in the war. In that way we are specifying to use the libraries into the WAR
> instead of the ones supplied by JBossAS.
>
> Here are the steps (might be useful for a future documentation):
> 1) Modify the web.xml that use the correct schemaLocation
>
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>
> 2) Remove the context.xml as it was mentioned in another thread (both from
> WEB-INF and META-INF)
> 3) Remove the servlet-2.3.jar (that might be not necessary...)
> 4) Add a jboss-web.xml file in the WEB-INF folder
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
>       "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
> <jboss-web>
>       <class-loading java2ClassLoadingCompliance="true">
>           <loader-repository>
> org.atmosphere:loader=atmosphere-pubsub.war
>           </loader-repository>
>       </class-loading>
> </jboss-web>
>
> Enjoy it
>

Great work! Many thanks. I will update all samples so that file gets
added automatically. Can you cut&past the log after the file gets
deployed? I want to make sure JBoss Comet native API got detected. I
suspect removing the context.xml may block it.

Thanks

-- Jeanfrancois



> Cheers,
> Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Luca Merolla
@Jeanfrancois
Here it is the log.

18:27:18,510 INFO  [TomcatDeployment] undeploy, ctxPath=/atmosphere-pubsub
18:27:21,307 INFO  [TomcatDeployment] deploy, ctxPath=/atmosphere-pubsub
18:27:21,416 WARNING [Atmosphere] Missing META-INF/atmosphere.xml. Will try to autodetect AtmosphereHandler
18:27:21,419 INFO  [Atmosphere] Atmosphere using Broadcaster org.atmosphere.cpr.DefaultBroadcaster
18:27:21,432 WARNING [Atmosphere] Missing META-INF/atmosphere.xml but found the Jersey runtime. Starting Jersey
18:27:21,461 WARNING [Atmosphere] Found multiple containers, please specify which one to use: org.atmosphere.container.JBossWebCometSupport, org.atmosphere.container.TomcatCometSupport,  until you do, Atmosphere will use the _default_ comet support!
18:27:21,461 INFO  [Atmosphere] Atmosphere is using for CometSupport: org.atmosphere.container.BlockingIOCometSupport running under container JBoss Web/2.1.3.GA
18:27:21,480 INFO  [WebAppResourceConfig] Scanning for root resource and provider classes in the Web app resource paths:
  /WEB-INF/lib
  /WEB-INF/classes
18:27:22,283 INFO  [ScanningResourceConfig] Root resource classes found:
  class org.atmosphere.samples.pubsub.PubSub
  class org.atmosphere.commons.jersey.ResourceChat
18:27:22,283 INFO  [ScanningResourceConfig] Provider classes found:
  class org.atmosphere.jersey.BroadcasterInjector
  class org.atmosphere.jersey.BroadcasterLookupInjector
  class org.atmosphere.jersey.AtmosphereResourceInjector
  class org.atmosphere.jersey.AtmosphereResourceConfigurator
18:27:22,429 INFO  [WebApplicationImpl] Initiating Jersey application, version 'Jersey: 1.1.5 01/20/2010 03:55 PM'
18:27:22,436 INFO  [WebApplicationImpl] Adding the following classes declared in META-INF/services/jersey-server-components to the resource configuration:
  class org.atmosphere.jersey.BroadcasterInjector
  class org.atmosphere.jersey.AtmosphereProviders$BroadcasterProvider
  class org.atmosphere.jersey.BroadcasterLookupInjector
  class org.atmosphere.jersey.AtmosphereResourceInjector
  class org.atmosphere.jersey.AtmosphereResourceConfigurator
18:27:23,315 INFO  [Atmosphere] Atmosphere Framework 0.5 started.


Cheers,
Luca
Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2
Thanks. Can you add the log after the first request? Right now I do see:

 > 18:27:21,461 WARNING [Atmosphere] Found multiple containers, please
specify
 > which one to use: org.atmosphere.container.JBossWebCometSupport,
 > org.atmosphere.container.TomcatCometSupport,  until you do,
Atmosphere will
 > use the _default_ comet support!
 > 18:27:21,461 INFO  [Atmosphere] Atmosphere is using for CometSupport:
 > org.atmosphere.container.BlockingIOCometSupport running under container

But Atmosphere is supposed to switch to JBossWebCometSupport after the
first request. If not that means context.xml is needed (or the
equivalent in jboss-web.xml)

Thanks!

-- Jeanfrancois


On 10-02-01 1:28 PM, Luca Merolla wrote:

>
> @Jeanfrancois
> Here it is the log.
>
> 18:27:18,510 INFO  [TomcatDeployment] undeploy, ctxPath=/atmosphere-pubsub
> 18:27:21,307 INFO  [TomcatDeployment] deploy, ctxPath=/atmosphere-pubsub
> 18:27:21,416 WARNING [Atmosphere] Missing META-INF/atmosphere.xml. Will try
> to autodetect AtmosphereHandler
> 18:27:21,419 INFO  [Atmosphere] Atmosphere using Broadcaster
> org.atmosphere.cpr.DefaultBroadcaster
> 18:27:21,432 WARNING [Atmosphere] Missing META-INF/atmosphere.xml but found
> the Jersey runtime. Starting Jersey
> 18:27:21,461 WARNING [Atmosphere] Found multiple containers, please specify
> which one to use: org.atmosphere.container.JBossWebCometSupport,
> org.atmosphere.container.TomcatCometSupport,  until you do, Atmosphere will
> use the _default_ comet support!
> 18:27:21,461 INFO  [Atmosphere] Atmosphere is using for CometSupport:
> org.atmosphere.container.BlockingIOCometSupport running under container
> JBoss Web/2.1.3.GA
> 18:27:21,480 INFO  [WebAppResourceConfig] Scanning for root resource and
> provider classes in the Web app resource paths:
>    /WEB-INF/lib
>    /WEB-INF/classes
> 18:27:22,283 INFO  [ScanningResourceConfig] Root resource classes found:
>    class org.atmosphere.samples.pubsub.PubSub
>    class org.atmosphere.commons.jersey.ResourceChat
> 18:27:22,283 INFO  [ScanningResourceConfig] Provider classes found:
>    class org.atmosphere.jersey.BroadcasterInjector
>    class org.atmosphere.jersey.BroadcasterLookupInjector
>    class org.atmosphere.jersey.AtmosphereResourceInjector
>    class org.atmosphere.jersey.AtmosphereResourceConfigurator
> 18:27:22,429 INFO  [WebApplicationImpl] Initiating Jersey application,
> version 'Jersey: 1.1.5 01/20/2010 03:55 PM'
> 18:27:22,436 INFO  [WebApplicationImpl] Adding the following classes
> declared in META-INF/services/jersey-server-components to the resource
> configuration:
>    class org.atmosphere.jersey.BroadcasterInjector
>    class org.atmosphere.jersey.AtmosphereProviders$BroadcasterProvider
>    class org.atmosphere.jersey.BroadcasterLookupInjector
>    class org.atmosphere.jersey.AtmosphereResourceInjector
>    class org.atmosphere.jersey.AtmosphereResourceConfigurator
> 18:27:23,315 INFO  [Atmosphere] Atmosphere Framework 0.5 started.
>
>
> Cheers,
> Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Luca Merolla
Hi,

I think there is something weird. If I type http://localhost:8080/atmosphere-pubsub/topictest in the URL of the browser I get the OK message but nothing is logging on the server.
I have even run the server in debug mode, but nothing show up.

Only doing "curl -X POST http://localhost:8080/atmosphere-pubsub/" I get some output, and it is not very promising....
19:19:49,825 SEVERE [ContainerRequest] A message body reader for Java type, interface javax.ws.rs.core.MultivaluedMap, and MIME media type, application/octet-stream, was not found

What is the best way to test it properly?

Cheers,
Luca
Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2
Salut,

On 10-02-01 2:23 PM, Luca Merolla wrote:

>
> Hi,
>
> I think there is something weird. If I type
> http://localhost:8080/atmosphere-pubsub/topictest in the URL of the browser
> I get the OK message but nothing is logging on the server.
> I have even run the server in debug mode, but nothing show up.
>
> Only doing "curl -X POST http://localhost:8080/atmosphere-pubsub/" I get
> some output, and it is not very promising....
> 19:19:49,825 SEVERE [ContainerRequest] A message body reader for Java type,
> interface javax.ws.rs.core.MultivaluedMap, and MIME media type,
> application/octet-stream, was not found
>
> What is the best way to test it properly?

I just did:

% curl http://localhost:8080/atmosphere-pubsub/chat

so the connection got suspended, then I did:

% curl -d message=boooo  http://localhost:8080/atmosphere-pubsub/chat

and I did see the broadcast.

Thanks

-- Jeanfrancois


>
> Cheers,
> Luca
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Luca Merolla
Hi,

this is the output after sending a message:

18:38:09,320 INFO  [JGroupsFilter] Starting Atmosphere JGroups Clustering support
18:38:09,804 WARN  [UDP] send buffer of socket java.net.DatagramSocket@1494c38 was set to 640KB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max send buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
18:38:09,804 WARN  [UDP] receive buffer of socket java.net.DatagramSocket@1494c38 was set to 20MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
18:38:09,805 WARN  [UDP] send buffer of socket java.net.MulticastSocket@bf9884 was set to 640KB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max send buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
18:38:09,805 WARN  [UDP] receive buffer of socket java.net.MulticastSocket@bf9884 was set to 25MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
18:38:09,845 INFO  [STDOUT]
---------------------------------------------------------
GMS: address is 127.0.0.1:33940 (cluster=chat)
---------------------------------------------------------
18:38:11,957 INFO  [STDOUT] onBroadcast: org.atmosphere.cpr.AtmosphereResourceEventImpl@c40b26

Hope it helps.

Luca
Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

jfarcand-2
Salut,

On 10-02-02 1:39 PM, Luca Merolla wrote:

>
> Hi,
>
> this is the output after sending a message:
>
> 18:38:09,320 INFO  [JGroupsFilter] Starting Atmosphere JGroups Clustering
> support
> 18:38:09,804 WARN  [UDP] send buffer of socket
> java.net.DatagramSocket@1494c38 was set to 640KB, but the OS only allocated
> 131.07KB. This might lead to performance problems. Please set your max send
> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
> 18:38:09,804 WARN  [UDP] receive buffer of socket
> java.net.DatagramSocket@1494c38 was set to 20MB, but the OS only allocated
> 131.07KB. This might lead to performance problems. Please set your max
> receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
> 18:38:09,805 WARN  [UDP] send buffer of socket
> java.net.MulticastSocket@bf9884 was set to 640KB, but the OS only allocated
> 131.07KB. This might lead to performance problems. Please set your max send
> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
> 18:38:09,805 WARN  [UDP] receive buffer of socket
> java.net.MulticastSocket@bf9884 was set to 25MB, but the OS only allocated
> 131.07KB. This might lead to performance problems. Please set your max
> receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
> 18:38:09,845 INFO  [STDOUT]
> ---------------------------------------------------------
> GMS: address is 127.0.0.1:33940 (cluster=chat)
> ---------------------------------------------------------
> 18:38:11,957 INFO  [STDOUT] onBroadcast:
> org.atmosphere.cpr.AtmosphereResourceEventImpl@c40b26

Yes the JGroups stuff is expected.


>
> Hope it helps.

I did test JBoss 5 this morning, thanks to the jboss-web.xml trick. Your
configuration looks OK to me as Atmosphere is using the
BlockingIOCometSupport because the JBoss Native Connector hasn't been
installed so it is the only way Comet can be supported.

Take a look at:

   * http://is.gd/7yIBX

if you want to install the connector. But so far everything looks OK. Is
the demo work fine for you?

A=

-- jeanfrancois





>
> Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: (Jersey/Jaxb issue) Re: PubSub example on JBoss

Luca Merolla
Hi Jeanfrancois,

sorry, I forgot to say that it was working fine. I just had some doubts how to test it, but after you told me the trick it was fine.

About the JBoss running with the APR I was trying already... but I have read in the jboss forums that there are issues with the run.sh script and the java classpath. So to me it was not working.

I'll probably give it a try later on.

For now, thanks a lot

Cheers,
Luca
12