4 Replies Latest reply on Dec 9, 2008 4:32 PM by ahmedmhyd

    WebContext annotation and contextRoot

    fbenvegna

      I have a web-service (Session EJB3 as WS) within web application named 'wmi'.
      My web context root is 'wmi'.
      The original wsdl url is http://host:port/wmi-wmi/beanClassName?wsdl.

      I want wsdl url as http://host:port/wmi/services?wsdl

      The problem is that when I set @WebContext(contextRoot = "/wmi" , urlPattern="/services") on EJB3, url http::/wmi/services?wsdl return 404 (page not found).
      But set @WebContext(contextRoot = "/wmi-ws" , urlPattern="/services") works fine (http://host:port/wmi-ws/services?wsdl).

        • 1. Re: WebContext annotation and contextRoot
          kr8m3r_78

          Did you ever get this problem solved?

          • 2. Re: WebContext annotation and contextRoot
            kr8m3r_78

            I seem to have the same problem:

            I have a problem in that my EJB jar deploys a web service, which uses the @WebContext annotation, but the context root points to the same context root of one defined in my war, both of which are packaged inside an EAR. If I deploy the EAR everything defined in the web.xml inside the war is accessible, but accessing the web service using the same context gets a 404 error.

            For example, my webservice:

            Code:

            @WebContext(contextRoot = "/testWeb", urlPattern = "/SupplierAccessPort", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
            


            In my jboss-web.xml (inside the war):

             <jboss-web>
             <security-domain>java:/jaas/aipDBCheck</security-domain>
             <context-root>/testWeb</context-root>
             </jboss-web>
            


            http://localhost:8080/testWeb/index.htm is found (as it is inside my war)
            http://localhost:8080/testWeb/SupplierAccessPort gets a 404.

            • 3. Re: WebContext annotation and contextRoot
              peterj

              Here is my guess:

              Web apps and web services are handled by two entirely different components. Once the decision is made to pass the incoming message to the web app component (based on the context), that component will not afterwards pass the message on to the web services component.

              I have never tried to place information about a web app and web service into the same web.xml file, and bundle them together into the same WAR file. It that works, perhaps that would suffice for what you want to do.

              • 4. Re: WebContext annotation and contextRoot
                ahmedmhyd

                Was any one able to solve this issue?
                Thanks