[jboss-jira] [JBoss JIRA] (WFLY-10613) Warning message when accessing endpoint in deployment with two Application subclasses with same @Path
Katerina Odabasi (JIRA)
issues at jboss.org
Tue Jun 26 04:26:00 EDT 2018
[ https://issues.jboss.org/browse/WFLY-10613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Katerina Odabasi reassigned WFLY-10613:
---------------------------------------
Assignee: Katerina Odabasi (was: R Searls)
> Warning message when accessing endpoint in deployment with two Application subclasses with same @Path
> -----------------------------------------------------------------------------------------------------
>
> Key: WFLY-10613
> URL: https://issues.jboss.org/browse/WFLY-10613
> Project: WildFly
> Issue Type: Enhancement
> Reporter: Katerina Odabasi
> Assignee: Katerina Odabasi
> Fix For: 14.0.0.CR1
>
> Attachments: RESTEASY-1445.zip
>
>
> 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:
> {code:java}
> @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;
> }
> }
> {code}
> And each has resource with the same @Path:
> {code:java}
> @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;
> }
> }
> {code}
> With the request:
> {code:java}
> Response response = client.target("http://localhost:8080/DuplicitePathTest/a/b/c").request().get();
> {code}
> 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)
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list