CXF Servlet fails to map 2 URLs
Issue
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)
Is there a way to map two URLs to a single servlet in EAP 5.2/WS CXF?
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.