Exception during handler processing
edwardpig Feb 9, 2012 10:40 AMTrying to deploy an EJB bundled in an EAR file on JBoss 5.1.0.GA using Seam 2.2.1 Final.
I'm declaring my EJB as a web service using the '@WebService' annotation. If I bundle and deploy my EJB without Seam, my remote client can talk to my web service without any problems.
However, once I try to add Seam, my web service deploys just fine --- I can even view the WSDL in a web browser --- but when I try to make a remote call to it, I get an exception. Here's the first part of the stack trace:
09:03:26,447 ERROR [HandlerChainExecutor] Exception during handler processing
java.lang.NullPointerException
at org.jboss.seam.servlet.ServletApplicationMap.get(ServletApplicationMap.java:54)
at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:49)
at org.jboss.seam.Component.forName(Component.java:1950)
at org.jboss.seam.Component.getInstance(Component.java:2008)
at org.jboss.seam.Component.getInstance(Component.java:2003)
at org.jboss.seam.Component.getInstance(Component.java:1997)
at org.jboss.seam.Component.getInstance(Component.java:1970)
at org.jboss.seam.Component.getInstance(Component.java:1965)
at org.jboss.seam.web.ServletContexts.instance(ServletContexts.java:42)
at org.jboss.seam.webservice.SOAPRequestHandler.handleInbound(SOAPRequestHandler.java:74)
at org.jboss.seam.webservice.SOAPRequestHandler.handleMessage(SOAPRequestHandler.java:57)
What I did to add Seam was:
- I added an 'ejb-jar.xml' file to the META-INF directory of my EJB jar file.
- I added a 'standard-jaxws-endpoint-config.xml' file to the META-INF directory of my EJB jar file.
- I added an empty 'seam.properties' file to the 'src/main/resources' directory of my EJB jar file.
Here is the content of my ejb-jar.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0">
<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>
{code}
and here is the content of my standard-jaxws-endpoint-config.xml:
{code:xml}
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2.0.xsd">
<endpoint-config>
<config-name>Seam WebService Endpoint</config-name>
<pre-handler-chains>
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>SOAP Request Handler</javaee:handler-name>
<javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
</endpoint-config>
</jaxws-config>
{code}
One other possibly relevant bit of information. When I deploy my EAR file, JBoss spits out a complaint about "Failed to read schema document 'jaxws-config_2.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. @ *unknown*[4,76]" I don't know whether this warning is related to the error I'm seeing.
So --- any ideas about what I'm doing wrong? I haven't found much that's helpful after a day of Googling.