Error: Cannot find context in host localhost

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error: Cannot find context in host localhost

gtalentolane
Hi, I am using  TomEE microprofile 8.0 on windows and modified the
server.xml so I have 3 services, Catalina and two new ones.

I am looking to be able to mount our restful services in different ports,
so the firewall can expose only the API of our front end app and the API
for the Admin can be used only on the inside network.

Deploying simple JAX-RS WARS works well when the server.xml contains ONLY
Catalina service, but when the deployment is done with the modified
server.xml the following error shows up:

22-Dec-2019 10:38:26.478 GRAVE [Catalina-utility-2]
org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke error
invoking org.apache.tomee.webservices.TomeeJaxRsService@1534f01b
java.lang.IllegalStateException: Invalid context '/Stela_BackEnd'.  Cannot
find context in host localhost
at
org.apache.tomee.webservices.TomcatRsRegistry.createRsHttpListener(TomcatRsRegistry.java:102)
at
org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:486)
at
org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:296)
at
org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.openejb.observer.ObserverManager$MethodInvocation.invoke(ObserverManager.java:402)
at
org.apache.openejb.observer.ObserverManager$BeforeAndAfterInvocationSet.invoke(ObserverManager.java:499)
at
org.apache.openejb.observer.ObserverManager.doFire(ObserverManager.java:111)
at
org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:100)
at
org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:133)
at
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1783)
at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:193)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1849)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1620)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:305)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1151)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1353)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1335)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
Source)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
22-Dec-2019 10:38:26.522 INFORMACIÓN [Catalina-utility-2]
sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web
application archive
[D:\apache-tomee-microprofile-8.0.0\STB-BE\Stela_BackEnd.war] has finished
in [4.064] ms
22-Dec-2019 10:40:16.346 INFORMACIÓN [main]
sun.reflect.NativeMethodAccessorImpl.invoke Nombre de la versión del
servidor:   Apache Tomcat (TomEE)/9.0.22 (8.0.0)

The WAR was copied to the corresponding folder, and automatically TOMEE
tried to deploy.

Any hints?

Thanks,
Guillermo
Reply | Threaded
Open this post in threaded view
|

Re: Error: Cannot find context in host localhost

gtalentolane
Finally I have found that the problem was that each service was using
"localhost" as the host, and that seemed to be the problem.

I have changed the host in each service to a different value, and now
everything works as expected, WAR deployment works fine, and each app
responds in is assigned port.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Reply | Threaded
Open this post in threaded view
|

Re: Error: Cannot find context in host localhost

Richard Monson-Haefel
Cool!

On Sun, Dec 22, 2019 at 11:37 AM gtalentolane <[hidden email]>
wrote:

> Finally I have found that the problem was that each service was using
> "localhost" as the host, and that seemed to be the problem.
>
> I have changed the host in each service to a different value, and now
> everything works as expected, WAR deployment works fine, and each app
> responds in is assigned port.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>
--
Richard Monson-Haefel
https://twitter.com/rmonson
https://www.linkedin.com/in/monsonhaefel/