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

UriBuilder.fromMethod not accepting valid method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.7.Final
    • None
    • None
    • None

    Description

      Here's my exception with some debug output.

       [DEBUG] RESTCtrlForAnIndividualsActivitiesTest - method: createActivity [@javax.ws.rs.PUT(), @javax.ws.rs.Path(value={activity})]
           Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.627 sec <<< FAILURE! - in com.lm.activity.RESTCtrlForAnIndividualsActivitiesTest
      testCreateActivity(com.lm.activity.RESTCtrlForAnIndividualsActivitiesTest)  Time elapsed: 0.129 sec  <<< ERROR!
      java.lang.IllegalArgumentException: No @Path annotated method for com.lm.activity.RESTCtrlForAnIndividualsActivities.createActivity
              at org.jboss.resteasy.specimpl.ResteasyUriBuilder.path(ResteasyUriBuilder.java:394)
              at javax.ws.rs.core.UriBuilder.fromMethod(UriBuilder.java:182)
              at com.lm.activity.RESTCtrlForAnIndividualsActivitiesTest.testCreateActivity(RESTCtrlForAnIndividualsActivitiesTest.java:47)
      

      and the calling code that causes the exception

              URI uri
                      = UriBuilder
                      .fromMethod( resourceClass, "createActivity" )
                      .build( randomUUID(), randomUUID() );
      

      Here's the code that generates the debug output

              Arrays.asList( resourceClass.getDeclaredMethods() )
                      .parallelStream().forEach( method -> log.debug( "method: {} {}", method.getName(), Arrays.toString( method.getDeclaredAnnotations() ) ) );
      

      and here's the method definition.

          @PUT
          @Path( "{activity}" )
          Response createActivity(
                  @Context UriInfo uri,
                  @PathParam( "individual" ) IndividualBuilder ib,
                  @PathParam( "activity" ) UUID activityId,
                  Activity activity
          ) {
      

      It's possible that I'm wrong that it works like this

      https://github.com/resteasy/Resteasy/blob/94af81fdbebfa58d0fea1d2469cc1f5f7e7eac42/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/LinkTest.java#L97

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            xenoterracide_jira Caleb Cushing (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: