Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-5316

Warning message when accessing endpoint in deployment with two Application subclasses with same @Path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.2.0.CD14
    • None
    • REST, Undertow
    • None

    Description

      Warning message could be logged, if deployment contains two Application subclass with same @ApplicationPath and same @Path annotation in their end-points.

      One deployment contains two application subclasses with the same @ApplicationPath:

      @ApplicationPath("a")
      public class DuplicitePathDupliciteApplicationOne extends Application {
          @Override
          public Set<Class<?>> getClasses() {
              HashSet<Class<?>> set = new HashSet<Class<?>>();
              set.add(DuplicitePathDupliciteResourceOne.class);
              return set;
          }
      }
      
      @ApplicationPath("a")
      public class DuplicitePathDupliciteApplicationTwo extends Application {
          @Override
          public Set<Class<?>> getClasses() {
              HashSet<Class<?>> set = new HashSet<Class<?>>();
              set.add(DuplicitePathDupliciteResourceTwo.class);
              return set;
          }
      }
      

      And each has resource with the same @Path:

      @Path("/b")
      public class DuplicitePathDupliciteResourceOne {
          public static final String DUPLICITE_RESPONSE = "response4";
      
          @Path("/c")
          @GET
          @Produces(MediaType.TEXT_PLAIN)
          public String duplicite() {
              return DUPLICITE_RESPONSE;
          }
      }
      
      @Path("/b")
      public class DuplicitePathDupliciteResourceTwo {
          public static final String DUPLICITE_RESPONSE = "response5";
      
          @Path("/c")
          @GET
          @Produces(MediaType.TEXT_PLAIN)
          public String dupliciteOne() {
              return DUPLICITE_RESPONSE;
          }
      }
      

      With the request:

      Response response = client.target("http://localhost:8080/DuplicitePathTest/a/b/c").request().get();
      

      Warning in the server log should be logged as two different resources matches the request.

      See the test in the upstream testsuite - org.jboss.resteasy.test.response.DuplicitePathTest.testDuplicationTwoAppTwoResourceSameMethodPath() (excluded from running with testsuite by default)

      Attachments

        Issue Links

          Activity

            People

              rhn-support-asoldano Alessio Soldano
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: