jersey
  1. jersey
  2. JERSEY-1466

When using "explicit root resources" UriBuilder.path(Class) throws IllegalArgumentException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.9
    • Fix Version/s: 1.18
    • Component/s: core
    • Labels:
      None
    • Environment:

      Ubuntu 11:10, Jetty 7.6

      Description

      When using "explicit root resources" (i.e. the ResourceConfig class returns a non-empty map from getExplicitRootResources) UriBuilder.path(Class) throws IllegalArgumentException because of lack of @Path annotation.

      Expected behavior is that Jersey will look at the explicit root resource map to find any path associated with the class before looking at the @Path annotation.

        Activity

        Hide
        Michal Gajdos added a comment - - edited

        Are you using UriBuilder.path(Class) directly or is the exception thrown during processing explicit root resources (which you registered) by Jersey? Because UriBuilder.path(Class) is supposed to throw an IllegalArgumentException if the given class is not annotated with @Path, see javadoc:

        /**
         * ...
         * @throws IllegalArgumentException if resource is null, or if resource is not annotated with {@link javax.ws.rs.Path}
         */
        
        Show
        Michal Gajdos added a comment - - edited Are you using UriBuilder.path(Class) directly or is the exception thrown during processing explicit root resources (which you registered) by Jersey? Because UriBuilder.path(Class) is supposed to throw an IllegalArgumentException if the given class is not annotated with @Path , see javadoc: /** * ... * @ throws IllegalArgumentException if resource is null , or if resource is not annotated with {@link javax.ws.rs.Path} */
        Hide
        Marek Potociar added a comment -

        Not a critical issue. The fix would break JAX-RS TCK tests. Will not fix.

        Show
        Marek Potociar added a comment - Not a critical issue. The fix would break JAX-RS TCK tests. Will not fix.

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            bassmanitram
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: