You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2017/11/18 13:02:00 UTC
[jira] [Commented] (TOMEE-2148) 404 in multiple jax rs application
context
[ https://issues.apache.org/jira/browse/TOMEE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16258056#comment-16258056 ]
Romain Manni-Bucau commented on TOMEE-2148:
-------------------------------------------
App1 namespace includes app2 one so 404 can be expected.
> 404 in multiple jax rs application context
> ------------------------------------------
>
> Key: TOMEE-2148
> URL: https://issues.apache.org/jira/browse/TOMEE-2148
> Project: TomEE
> Issue Type: Bug
> Components: TomEE Core Server
> Affects Versions: 7.0.4
> Reporter: Florent Ulvé
> Priority: Minor
>
> When deploying a war file containing mulitple jax rs application, some jax rs routes return a http code 404 if one application have a empty @ApplicationPath.
> Note : provider auto scanning have to be disable.
> Example:
> {code:java}
> @ApplicationPath("/")
> public class App1 extends Application{
> @Override
> public Set<Class<?>> getClasses() {
> LinkedHashSet<Class<?>> set = new LinkedHashSet<Class<?>>();
> set.add(Hello.class);
> return set;
> }
> }
> {code}
> {code:java}
> @ApplicationPath("/app2")
> public class App2 extends Application {
>
> @Override
> public Set<Class<?>> getClasses() {
> LinkedHashSet<Class<?>> set = new LinkedHashSet<Class<?>>();
> set.add(Hello2.class);
> return set;
> }
>
> }
> {code}
> disable auto scanning in openejb-jar.xml
> {code:xml}
> <?xml version="1.0"?>
> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
> <pojo-deployment class-name="jaxrs-application">
> <properties>
> cxf.jaxrs.skip-provider-scanning = true
> </properties>
> </pojo-deployment>
> <pojo-deployment class-name="com.flo.App1">
> <properties>
> cxf.jaxrs.skip-provider-scanning = true
> </properties>
> </pojo-deployment>
> <pojo-deployment class-name="com.flo.App2">
> <properties>
> cxf.jaxrs.skip-provider-scanning = true
> </properties>
> </pojo-deployment>
> </openejb-jar>
> {code}
> Deployment log are Ok but when trying to access an App2 route http://localhost:8080/war/app2/hello an 404 NotFoundException is thrown:
> {code:java}
> nov. 17, 2017 7:24:35 PM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
> AVERTISSEMENT: javax.ws.rs.NotFoundException: HTTP 404 Not Found
> at org.apache.cxf.jaxrs.utils.SpecExceptions.toNotFoundException(SpecExceptions.java:89)
> at org.apache.cxf.jaxrs.utils.ExceptionUtils.toNotFoundException(ExceptionUtils.java:129)
> at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:169)
> at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)