Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-11056

JAX-WS servlet with multiple url-pattern elements fails when using CXF: "Cannot obtain destination"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • TBD EAP 5
    • EAP_EWP 5.2.0
    • Web Services
    • None
    • Hide

      Create two <servlet> elements in your web.xml, and use the same <servlet-class> in each. You can then use a different <url-pattern> in each servlet definition:

      <servlet>
        <servlet-name>SampleWS</servlet-name>
        <servlet-class>com.sample.ws.SampleWSImpl</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>SampleWS</servlet-name>
        <url-pattern>/b/c/myservice</url-pattern>
      </servlet-mapping>
      <servlet>
        <servlet-name>SampleWS1</servlet-name>
        <servlet-class>com.sample.ws.SampleWSImpl</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>SampleWS1</servlet-name>
        <url-pattern>/a/b/c/myservice</url-pattern>
      </servlet-mapping>
      
      Show
      Create two <servlet> elements in your web.xml, and use the same <servlet-class> in each. You can then use a different <url-pattern> in each servlet definition: <servlet> <servlet-name> SampleWS </servlet-name> <servlet-class> com.sample.ws.SampleWSImpl </servlet-class> </servlet> <servlet-mapping> <servlet-name> SampleWS </servlet-name> <url-pattern> /b/c/myservice </url-pattern> </servlet-mapping> <servlet> <servlet-name> SampleWS1 </servlet-name> <servlet-class> com.sample.ws.SampleWSImpl </servlet-class> </servlet> <servlet-mapping> <servlet-name> SampleWS1 </servlet-name> <url-pattern> /a/b/c/myservice </url-pattern> </servlet-mapping>
    • Not Yet Documented
    • NEW

      I have the following servlet defined in my web.xml:

      <servlet>
          <servlet-name>SampleWS</servlet-name>
          <servlet-class>com.sample.ws.SampleWSImpl</servlet-class>
      </servlet>
      <servlet-mapping>
          <servlet-name>SampleWS</servlet-name>
          <url-pattern>/a/b/c/myservice</url-pattern>
          <url-pattern>/b/c/myservice</url-pattern>
      </servlet-mapping>
      

      The first URL mapping works as expected. However the second URL mapping results in an HTTP STATUS 500 error with the following stack trace:

      javax.servlet.ServletException: Cannot obtain destination for: /b/c/myservice
          org.jboss.wsf.stack.cxf.ServletControllerExt.findDestination(ServletControllerExt.java:114)
          org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:168)
          org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:61)
          org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:185)
          org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
          org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
          org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      

              rhn-support-asoldano Alessio Soldano
              rh-ee-klape Kyle Lape
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: