[
https://issues.apache.org/jira/browse/CXF-8604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mike Mozaffari closed CXF-8604.
-------------------------------
Resolution: Not A Bug
> CXF warning logs: equal candidates for handling the request which can lead to
> unpredictable results
> ---------------------------------------------------------------------------------------------------
>
> Key: CXF-8604
> URL: https://issues.apache.org/jira/browse/CXF-8604
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.4.3
> Reporter: Mike Mozaffari
> Priority: Major
>
> I have the following GET method:
> {code:java}
> @GET
> @Produces("application/json")
> @Path("getpoolinfo")
> public String getPoolInfo(@QueryParam("userid") int userid) {
> return requestHandler.getPoolList(userid);
> }
> {code}
> In the logs I see a lot of warning messages:
> {code:java}
> 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
> {code}
> Please note that it is pointing to the same method of the same class.
> I am using the following libraries of CXF:
> {code:java}
> <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>
> {code}
> I am using the following code to create the server:
> {code:java}
> JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
> sf.setResourceClasses(MyClass.class);
> sf.setResourceProvider(MyClass.class, new SingletonResourceProvider(new
> MyClass()));
> {code}
> It seems *setResourceClasses* and *setResourceProvider* causes a duplicate in
> class resource info, which causes the warning.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)