Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8604

CXF warning logs: equal candidates for handling the request which can lead to unpredictable results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 3.4.3
    • None
    • JAX-RS
    • None
    • Unknown

    Description

      I have the following GET method:

          @GET
          @Produces("application/json")
          @Path("getpoolinfo")
          public String getPoolInfo(@QueryParam("userid") int userid) {
              return requestHandler.getPoolList(userid);
          }
      

      In the logs I see a lot of warning messages:

          2021-10-06 20:27:37,860 WARN  [qtp1072377306-76] [JAXRSUtils] Both 
          com.package.name.ClassName#getPoolInfo and 
          com.package.name.ClassName#getPoolInfo 
          are equal candidates for handling the current request which can lead to unpredictable results
      

      Please note that it is pointing to the same method of the same class.

      I am using the following libraries of CXF:

      <dependency>
      	<groupId>org.apache.cxf</groupId>
      	<artifactId>cxf-rt-frontend-jaxrs</artifactId>
      	<version>3.4.3</version>
      </dependency>
      <dependency>
      	<groupId>org.apache.cxf</groupId>
      	<artifactId>cxf-rt-transports-http-jetty</artifactId>
      	<version>3.4.3</version>
      </dependency>
      

      I am using the following code to create the server:

      JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
      sf.setResourceClasses(MyClass.class);
      sf.setResourceProvider(MyClass.class, new SingletonResourceProvider(new MyClass()));
      

      It seems setResourceClasses and setResourceProvider causes a duplicate in class resource info, which causes the warning.

      Attachments

        Activity

          People

            Unassigned Unassigned
            MikeMozaff Mike Mozaffari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: