Description of problem:
jax-rs doesn't work correctly if HttpServletDispatcher is used and application class doesn't return end-point classes by getClasses method
RESTEasy doesn't detect end-point classes in application, if this classes are not specified in Application class. But specifying of end-points in application class is not necessary, if HttpServletDispatcher is not used as servlet in web.xml.
Steps to Reproduce:
- mvn package
- deploy
- curl -v http://localhost:8080/jaxrs-wf/test/text
Actual results:
[mkopecky@dhcp-10-40-5-21 bin]$ curl -v http://localhost:8080/jaxrs-wf/test/text * Trying ::1... * connect to ::1 port 8080 failed: Connection refused * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /jaxrs-wf/test/text HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 404 Not Found < Connection: keep-alive < X-Powered-By: Undertow/1 < Server: JBoss-EAP/7 < Content-Length: 0 < Date: Wed, 04 Jan 2017 13:24:10 GMT < * Connection #0 to host localhost left intact [mkopecky@dhcp-10-40-5-21 bin]$
Workaround:
Define all end-points in application class:
@ApplicationPath("/") public class TestApplication extends Application { public static Set<Class<?>> classes = new HashSet<Class<?>>(); @Override public Set<Class<?>> getClasses() { classes.add(SimpleService.class); return classes; } }
- is related to
-
JBEAP-8124 Servlet-mapping for application using org.springframework.web.servlet.DispatcherServlet requires to add resources into Application subclass
- Closed
- relates to
-
JBEAP-8064 read-resource operation of jaxrs subsystem doesn't work if HttpServletDispatcher is used
- Closed