[jboss-jira] [JBoss JIRA] Resolved: (AS7-1349) JAX-RS sub resources broken

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Tue Jul 26 01:58:23 EDT 2011


     [ https://issues.jboss.org/browse/AS7-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart Douglas resolved AS7-1349.
---------------------------------

    Resolution: Done


> JAX-RS sub resources broken
> ---------------------------
>
>                 Key: AS7-1349
>                 URL: https://issues.jboss.org/browse/AS7-1349
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: Web Services
>    Affects Versions: 7.0.0.Final
>            Reporter: Jozef Hartinger
>            Assignee: Stuart Douglas
>            Priority: Critical
>             Fix For: 7.0.1.Final
>
>
> Having a root resource class
> @Path("person")
> public class PeopleResource {
>     @Path("{name}")
>     public PersonResource findPerson(@PathParam("name") String name)
>     {
>         return new PersonResource(name);
>     }
> }
> and a sub resource class
> public class PersonResource {
>     private String name;
>     public PersonResource(String name) {
>         this.name = name;
>     }
>     @GET
>     public String getName()
>     {
>         return name;
>     }
>     
>     @GET
>     @Path("/address")
>     public String getClassName()
>     {
>         return name + "'s address is unknown.";
>     }
> }
> The application fails with the following exception. Seems like during scanning the subresource is identified as a root resource (although it is not a root resource). Subsequently, RESTEasy's validation fails.
> javax.servlet.ServletException: Servlet.init() for servlet org.jboss.resteasy.cdi.test.MyApplication threw exception
> 	org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
> 	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
> 	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
> 	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
> 	java.lang.Thread.run(Thread.java:662)
> root cause
> java.lang.RuntimeException: Class is not a root resource.  It, or one of its interfaces must be annotated with @Path: org.jboss.resteasy.cdi.test.Subresource implements:  java.io.Serializable
> 	org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104)
> 	org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
> 	org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72)
> 	org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:367)
> 	org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:225)
> 	org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:67)
> 	org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
> 	org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
> 	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
> 	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
> 	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
> 	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
> 	java.lang.Thread.run(Thread.java:662)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list