tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-2148) 404 in multiple jax rs application context
Date Sun, 19 Nov 2017 17:29:00 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16258536#comment-16258536
] 

Romain Manni-Bucau commented on TOMEE-2148:
-------------------------------------------

sure, want to give it a try and send a github PR? The class with the information is https://github.com/apache/tomee/blob/master/server/openejb-rest/src/main/java/org/apache/openejb/server/rest/RESTService.java

> 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)

Mime
View raw message