3 Replies Latest reply on Oct 3, 2011 12:52 PM by pgmjsd

    JBoss AS 7 @WebContext EJB deployed in a WAR

    pgmjsd

      I've tried deploying a SOAP endpoint EJB in a WAR, as EJB3.1 allows.   When I added @WebContext (from the org.jboss.ws.api.annotation package), the rest of the web application stopped working.   I got The White Page Of Death for every single URL in the rest of the web UI.   I tried using WEB-INF/jboss-web.xml to specify the context as well, but that didn't work either.

       

      The EJB is deployed in WEB-INF/classes, and it looks like this:

       

      @Stateless(name = "ExampleBean")
      @WebService(name = "ExampleWS", targetNamespace = "http://ws.fooco.com/2011/10")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      @WebContext(contextRoot = "/api")
      public class ExampleBean implements ExampleWS
      {
      ...
      }
      

       

      WEB-INF/jboss-web.xml looks like this:

       

      <?xml version="1.0"?>
      <!DOCTYPE jboss-web PUBLIC
         "-//JBoss//DTD Web Application 5.0//EN"
         "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
      <jboss-web>
          <context-root>/</context-root>
      </jboss-web>
      
      

       

      Is this not supported?  That would make sense to me, as it is possible to have conflicting web contexts in the same WAR.    However, I think it would be reasonable to issue a warning or an error message.   If the contexts are the same, then maybe this could be supported?

       

      Not sure what I'm going to do to work around this issue.  I suppose I could deploy the app as an EAR, and put the web service endpoint in an ejb-jar.   That way the web UI would be in a separate web context.   That's probably a better design anyway.