JBoss Community

Re: JBossWS + CXF + Spring + Maven triggers "java.lang.NoClassDefFoundError: javax/servlet/ServletException"

created by stephen b in JBoss Web Services - View the full discussion

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

Start a new discussion in JBoss Web Services at Community