Hi It works on trunk i think
1.5 got issues with root context Le 11 juin 2013 08:22, "exabrial12" <[email protected]> a écrit : > Hey guys, I have a pretty simple JAX-RS application that I'm trying to > deploy > on a virtualhost. TomEE 1.5.2+ really freaks out: > > @ApplicationPath("/api") > public class NetQuoteApplication extends Application { > /** > * {@inheritDoc} > */ > @Override > public Set<Class<?>> getClasses() { > return new > HashSet<Class<?>>(Arrays.asList(XMLEndpoint.class, > RestExceptionMapper.class)); > } > } > > @Path("xml/leads/vendor/netquote") > @Consumes({ MediaType.APPLICATION_XML, > MediaType.APPLICATION_FORM_URLENCODED > }) > @Produces(MediaType.APPLICATION_XML) > @ApplicationScoped > public class XMLEndpoint extends NetQuoteRestController { > } > > public abstract class NetQuoteRestController { > @Inject > private Logger log; > @Inject > private Event<NetQuoteData> netQuoteBus; > > @POST > @Path("create") > public NetQuoteResponse create(@FormParam("LeadData") String > leadData) { > log.debug("create() leadData:{}", leadData); > netQuoteBus.fire(JAXB.unmarshal(new StringReader(leadData), > NetQuoteData.class)); > NetQuoteResponse netQuoteResponse = new NetQuoteResponse(); > netQuoteResponse.setResponseCode(ResponseTypes.ACCEPTED); > return netQuoteResponse; > } > } > > > SEVERE: error invoking > org.apache.openejb.observer.ObserverManager$Observer@652916e4 > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > > org.apache.openejb.observer.ObserverManager$Observer.invoke(ObserverManager.java:145) > at > > org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:69) > at > org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:107) > at > > org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1486) > at > > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:110) > at > > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) > at > > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) > at > > org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168) > at > > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) > at > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977) > at > org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) > at java.util.concurrent.FutureTask.run(FutureTask.java:166) > at > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:722) > Caused by: java.lang.IllegalStateException: Invalid context ''. Cannot > find > context in host localhost > at > > org.apache.tomee.webservices.TomcatRsRegistry.createRsHttpListener(TomcatRsRegistry.java:76) > at > org.apache.openejb.server.rest.RESTService.deployPojo(RESTService.java:433) > at > > org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:218) > at > > org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51) > ... 24 more > > > <Engine > name="Catalina" > defaultHost="localhost"> > > <Realm > className="org.apache.catalina.realm.LockOutRealm"> > <Realm > > className="org.apache.catalina.realm.UserDatabaseRealm" > resourceName="UserDatabase" /> > </Realm> > <Host > name="localhost" > appBase="localhost" > unpackWARs="true" > autoDeploy="true"> > </Host> > <Host > name="lead-dominator" > appBase="lead-dominator" > unpackWARs="true" > autoDeploy="true"> > </Host> > </Engine> > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/JAX-RS-severely-broken-when-virtual-hosts-are-used-tp4663598.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
