I tried to use the new CorsFilter
which is available in Resteasy 3.0.9. I found an example at the bottom of this page:
Ajax request with JAX-RS/RESTEasy implementing CORS
If I define this filter in the method getSingletons()
(of the Application
subclass) , then my Resources don't get scanned anymore. That means that no Resources will be found and the following error occurs:
javax.ws.rs.NotFoundException: Could not find resource for full path Error Occures
On the following page i found a description: javax.ws.rs.NotFoundException: Could not find resource for full path Error Occures
But basically, what this deployment option does is scan for annotations of @Path, @Provider, etc for the application. The reason is that JAX-RS will first look for classes and object in overridden getClasses() and getSingletons(), respectively. If then return empty sets, this tell JAX-RS to do scanning (per the spec).
So JAX-RS doesn't do a scanning if i overwrite the getSingletons()
method? Is there another way to configure this CorsFilter
and enable the resource scanning`?