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

Inheritance of subresources: not-annotated class in the middle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 2.3-RC1
    • 2.2.3.GA
    • None

      I have abstract class CrudHandler<T> which is predecessor of all CRUD-like subresources. This class is not mapped to any path itself, but has full annotated (including @Path) final methods for CRUD operations and abstract methods for implementing specific stuff in descendants. From this class is inherited subresource class "Accounts extends CrudHandler<Account>" which hasn't any annotations, but only implements those abstract methods. Class Accounts is instantiated from another class Api in method with @Path("/accounts") annotation. Api class itself is mapped to @Path("/api").

      When I call method /api/accounts/create then RESTeasy failed with RuntimeException "Unable to determine value of type parameter T".

      But when I try to add any fake empty method to Accounts class and annotate it with @Path("/blahblah") annotation, call to /api/accounts/create works.

      I did some debug and found this: GetRestful.getSubResourceClass() tries to find proper class in inheritance hierarchy but ignored completely classes without JAX-RS annotations. In my case first class in hierarchy with annotations is generic. But I'm not sure if this is the right place to fix.

              patriot1burke@gmail.com Bill Burke (Inactive)
              mschayna_jira Martin Schayna (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: