NoClassDeFoundError WSServletContextListener and XMLStreamBuffer
Asked Answered
D

3

7

I'm getting the following error while trying to deploy a JAX-WS Maven-project to JBOSS6.0.0.

17:45:03,451 ERROR [[/isp]] Error configuring application listener of class com
sun.xml.ws.transport.http.servlet.WSServletContextListener: java.lang.NoClassDe
FoundError: javax/servlet/ServletContextAttributeListener
    at java.lang.ClassLoader.findBootstrapClass(Native Method) [:1.6.0_24]
    at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:927)
[:1.6.0_24]
...

My Pom-file has the following as dependency:

<dependency>  
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.1.4</version>
    <scope>provided</scope>
</dependency>

I tried putting the jar-file in common/lib, /lib, or /lib/endorsed but still get the same.
A lot of people had this problems and there's quite some answer but nothing I found and tried worked.

Update
So, I tried putting the lib in WEB-INF/lib instead. And that takes away the previous error. However, a new error is now showing up. Here's the stack trace:

09:00:46,353 ALLVARLIG [http] WSSERVLET11: failed to parse runtime descriptor: j
ava.lang.NoClassDefFoundError: com/sun/xml/stream/buffer/XMLStreamBuffer: java.l
ang.NoClassDefFoundError: com/sun/xml/stream/buffer/XMLStreamBuffer
    at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.ja
va:424) [:2.1.4]
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.
java:196) [:2.1.4]
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467) [:2.
Dichromaticism answered 25/5, 2011 at 15:58 Comment(0)
D
14

Well this was ridiculous.

I added all jar-files from the JAXWS-rt download (http://jax-ws.java.net/2.2.1/) and copied all of the jar-files in the /lib catalog into JBOSS_HOME/servers/default/lib.

Worked good after that. Still can't believe I dry humped this for so long.

Well, all good now.

Dichromaticism answered 26/5, 2011 at 8:55 Comment(2)
Any post containing the phrase "dry humped" deserves a useful vote-up.Outlying
Works in Tomcat too in lib directoryRhone
P
1

I had a similar problem. My POM contained

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.3.2</version>
    <type>pom</type>
</dependency>

and I was getting com.sun.xml.ws.transport.http.servlet.WSServletContextListener class not found.

I removed <type>pom</type> and the server started without error. The web service also functions correctly.

Pileup answered 16/9, 2019 at 9:48 Comment(0)
C
0

Your POM dependency should work, just remove:

<scope>provided</scope>

If you define it as scope, it means your server will provide the jars, which, this is not the case for Tomcat.

Criticaster answered 9/7, 2019 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.