Jaxrs-rs doesn't detect sevlet-mapping, with custom path, specified in web.xml when custom Application subclass is used.
JAX-RS 2.0 specification requires to jax-rs implementations to recognize mapping in web.xml file. See section "2.3.2 Servlet"
When I deploy attached reproducer. I get this resource available:
[standalone@localhost:9990 /] /deployment=numbers.war/subsystem=jaxrs:read-resource(include-runtime=true,recursive=true) { "outcome" => "success", "result" => {"rest-resource" => {"com.airhacks.NumbersResource" => { "resource-class" => "com.airhacks.NumbersResource", "rest-resource-paths" => [{ "resource-path" => "numbers", "consumes" => undefined, "produces" => ["application/json"], "java-method" => "javax.json.JsonArray com.airhacks.NumbersResource.numbers()", "resource-methods" => ["GET /numbers/resources/numbers"] }], "sub-resource-locators" => undefined }}} }
Accessing the resource returns:
curl -v "http://localhost:8080/numbers/resources/numbers"
...
< HTTP/1.1 404 Not Found
Workaround exists - add context-param into web.xml to make the mapping available:
<context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/resources</param-value> </context-param>
This is not regression against EAP 6.4
- relates to
-
JBEAP-8124 Servlet-mapping for application using org.springframework.web.servlet.DispatcherServlet requires to add resources into Application subclass
- Closed
-
JBEAP-8013 [GSS](7.2.0) Impossible to use JAX-RS and Spring MVC in the same WEB application
- Reopened