Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-263

"Class is not a root resource."

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.RC1
    • 1.1.GA
    • jaxrs
    • None

      I changed from 1.1-RC2 to 1.1GA and started getting this error message:

      java.lang.RuntimeException: Class is not a root resource. It, or one of its interfaces must be annotated with @Path: com.redrata.entities.Organization$JAXRSOrgs$JAXRSOrg implements:
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:105)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:84)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:73)
      at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:160)
      at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:208)

      JAXRSOrg is, indeed, not a root resource. But I do not want it to be. jaxrsorgs is my root resource.

      Something to do with the fact that jaxrsorg and jaxrsperson share a common, abstract, class?

      Snippets of possibly relevant code

      @Path("/orgs")
      public static class JAXRSOrgs{
      @Path("org-

      {oid:[0-9]+}

      ")
      public JAXRSOrg getOrg(@PathParam(value = "oid") long oid) throws IOException

      { return new JAXRSOrg(blah); }

      }

      public abstract class JAXRSEntity {
      // a few @paths and @Gets
      }
      public static class JAXRSOrg extends JAXRSEntity {
      // a few @paths and @Gets
      }

      public static class JAXRSPerson extends JAXRSEntity {
      // a few @paths and @Gets
      }

              patriot1burke@gmail.com Bill Burke (Inactive)
              pbkwee_jira Peter Bryant (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: