tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Ulvé (JIRA) <j...@apache.org>
Subject [jira] [Created] (TOMEE-2148) 404 in multiple jax rs application context
Date Fri, 17 Nov 2017 18:38:00 GMT
Florent Ulvé created TOMEE-2148:
-----------------------------------

             Summary: 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, all 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 a route an exception 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