[Jersey-issues] [JIRA] Issue Comment Edited: (JERSEY-1634) Auto-scannning of WAR not working for default Application class

  • From: "gmazza (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [Jersey-issues] [JIRA] Issue Comment Edited: (JERSEY-1634) Auto-scannning of WAR not working for default Application class
  • Date: Thu, 10 Jan 2013 12:54:52 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated


    [ 
http://java.net/jira/browse/JERSEY-1634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=353178#action_353178
 ] 

gmazza edited comment on JERSEY-1634 at 1/10/13 12:54 PM:
----------------------------------------------------------

Are you sure?  The Application class is defined in the JAX-RS specification, 
so if no autoscanning is defined there then I would guess Jersey shouldn't 
autoscan for resources.  For portability, the sum of resources (root 
resources and providers) that a given Application subclass makes available 
should be the same regardless of the JAX-RS implementation it runs on.

      was (Author: gmazza):
    Are you sure?  The Application class is defined in the JAX-RS 
specification, so if no autoscanning is defined there then I would guess 
Jersey shouldn't autoscan for resources.  For portability, the sum of 
resources (root resources and providers) that a given Application subclass 
makes available should be the same regardless of the JAX-RS application it 
runs on.
  
> Auto-scannning of WAR not working for default Application class
> ---------------------------------------------------------------
>
>                 Key: JERSEY-1634
>                 URL: http://java.net/jira/browse/JERSEY-1634
>             Project: jersey
>          Issue Type: Bug
>            Reporter: arungupta
>
> If Application class is like:
> @ApplicationPath("webresources")
> public class MyApplication extends Application {
>    @Override
>    public Set<Class<?>> getClasses() {
>        Set<Class<?>> resources = new java.util.HashSet<>();
>        resources.add(org.sample.client.MyResource.class);
>        return resources;
>    }
> }
> then the resource is accessible at the defined path. But without overriding 
> getClasses() method, Jersey throws the following exception:
> javax.ws.rs.NotFoundException
>    at 
> org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:853)
>    at 
> org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:728)
>    at 
> org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:86)
>    at 
> org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:629)
>    at 
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:420)
>    at 
> org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:625)
>    at 
> org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:360)
>    at 
> org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:260)
> Default implementation of Application should trigger auto-scanning of 
> resources in the WAR.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Jersey-issues] [JIRA] Issue Comment Edited: (JERSEY-1634) Auto-scannning of WAR not working for default Application class

gmazza (JIRA) 01/10/2013
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20151030.c1dd42a)
 
 
Close
loading
Please Confirm
Close