NoClassDeFoundError WSServletContextListener and XMLStreamBuffer

I get the following error when 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 dependency:

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

I tried to put the jar file in the general / lib, / lib or / lib / but still get the same.
Many people had these problems, and there was quite some kind of answer, but I did not find anything and did not try to work.

Update
So, I tried putting lib in WEB-INF / lib instead. And this takes away the previous error. However, a new error now appears. 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. 
+7
source share
2 answers

Well it was funny.

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

After that it worked well. Still can't believe that I have been drying this for so long.

OK, now everything is fine.

+13
source

Your POM dependency should work, just remove:

 <scope>provided</scope> 

If you define it as a scope, it means that your server will provide jar files, which is not the case with Tomcat.

0
source

All Articles