[jboss-user] [JBoss Web Services] - Re: JBossWS + CXF + Spring + Maven triggers "java.lang.NoClassDefFoundError: javax/servlet/ServletException"
stephen b
do-not-reply at jboss.com
Sun Feb 24 00:04:45 EST 2013
stephen b [https://community.jboss.org/people/slbanal] created the discussion
"Re: JBossWS + CXF + Spring + Maven triggers "java.lang.NoClassDefFoundError: javax/servlet/ServletException""
To view the discussion, visit: https://community.jboss.org/message/799219#799219
--------------------------------------------------------------
At last I figured out the issue!
It looks like JBossWS-CXF jax-ws-client module have some issues in its dependencies thus causing the stack to throw a "+javax.servlet.ServletException"+ due to some missing dependency to "javax.servlet.api" module. I did the following steps to diagnose and fix the issue:
1. I fixed the module dependency issue of "+org.jboss.ws.jaxws-client" module in JBoss. I modified file JBOSS_HOME/+modules/org/jboss/ws/jaxws-client/main/module.xml and added line under <dependencies/> section.
<module name="javax.servlet.api" />
After this fix, JBossWS-CXF is now throwing the correct error. Example stack trace below:
15:54:14,958 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jboss-as-helloworld-ws].[HelloWorldService]] (http--127.0.0.1-8083-1) Servlet.service() for servlet HelloWorldService threw exception: javax.servlet.ServletException: JBWS024029: Cannot obtain destination for /jboss-as-helloworld-ws/hello-world
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.findDestination(RequestHandlerImpl.java:168)
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:85)
at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:156)
at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
2. I changed my jbossws-cxf.xml and fixed the jaxws endpoint address
From:
+ <jaxws:endpoint implementor="#HelloWorldService"+
+ address="/hello-world">+
+ </jaxws:endpoint>+
To:
<jaxws:endpoint implementor="#HelloWorldService"
address="*/jboss-as-helloworld-ws*/hello-world">
</jaxws:endpoint>
I don't understand why +org.jboss.ws.jaxws-clientI+ module doesn't have a dependency on javax.servlet.api dependency if it is throwing a ServletException.
Could this be a bug that I should report?
Thanks
Stephen
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799219#799219]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130224/75b2a22d/attachment.html
More information about the jboss-user
mailing list