1 Reply Latest reply on Sep 14, 2007 11:08 PM by juanm_med

    404 error when WS deployed in EAR

    isotope1145

      I deploy a JSR-181 EJB endpoint web-service in an .ear file and it works.

      However, when I embed a .war file in the ear I can no longer access the web-service. There are no deployment errors in the console, but when I try to access the WSDL I get an HTTP 404:
      The requested resource (/elixir-service/AppManagerBean) is not available" error.

      The ear file is named elixir-service.ear and the embedded war file is named elixir-service.war. The application.xml is as follows:

      <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
       <display-name>elixir-service</display-name>
       <module>
       <ejb>elixir-service.jar</ejb>
       </module>
      
       <module>
       <web>
       <web-uri>elixir-service.war</web-uri>
       <context-root>elixir-service</context-root>
       </web>
       </module>
      </application>


      If I change the <context-root> name in the application.xml file to something other than "elixir-service", then the web serivce works again. So there appears to be a conflict between the web-service root and the .war root.

      The following topic reports a similar problem:
      http://jboss.org/index.html?module=bb&op=viewtopic&p=3944094

      Is this a bug? If not, what conventions should I follow when deploying an .ear that contains both web-services and .war web resources?


        • 1. Re: 404 error when WS deployed in EAR
          juanm_med

          If you have your application in production, and so you cannot change its context-root, you can also change the name of the jar file where the Web Service is located. Rememeber to update your application.xml with the new name.

          This way, you can use your Web Service with the name of the jar file instead of the context of the web application.

          For example, if you have an application with a context root "myApp", which coincides with the name of the jar file "myApp.jar", you can change the jar file to "myAppServices.jar" and see your WSDL as:

          http://localhost:8080/myAppServices/MyService?wsdl

          as your application can still be accessed as:

          http://localhost:8080/myApp

          Hope it helps