Deploy grails3 war in Tomcat problem

182 views
Skip to first unread message

Joud

unread,
Feb 28, 2019, 9:53:50 AM2/28/19
to Grails Dev Discuss
Hi all, am trying to deploy my grails 3 app into tomcat 8.5.. When opening my app, I get HTTP Status 404 error and in the log I get this:

SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\MyApp.war
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyApp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any idea what might be the cause?

Justin Miranda

unread,
Feb 28, 2019, 10:47:45 AM2/28/19
to grails-de...@googlegroups.com
Is that all you see in the log? If not, can you include the entire log? 

Without more information my guess would be that this is a Tomcat dependency issue (i.e. there's an embedded Tomcat dependency in the WAR that needs to be removed)

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6fa74479-6826-4906-af63-c00ba1bd7890%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Leahy

unread,
Mar 1, 2019, 4:29:01 AM3/1/19
to Grails Dev Discuss
Hi, 
    i think Justin is correct.

If you have

compile "org.springframework.boot:spring-boot-starter-tomcat"

change to 

provided "org.springframework.boot:spring-boot-starter-tomcat"

so the internal tomcat instance will not interfere with the Tomcat 8.5 

Does your app run from the command line?

Does your app use datasources, how are they configured in your application.yml

do they refer directly to a datasource or are you using JNDI 
             
Regards,
                 Daniel Leahy.

Joud

unread,
Mar 1, 2019, 4:54:27 AM3/1/19
to Grails Dev Discuss
I already have the embedded Tomcat dependency as provided, I followed the instructions of deploying a war file to a container but am stuck in this error from yesterday -_-
Here's the entire log if it helps:

 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyApp]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.springframework.boot.cli.app.SpringApplicationWebApplicationInitializer.getSources(SpringApplicationWebApplicationInitializer.java:62)
at org.springframework.boot.cli.app.SpringApplicationWebApplicationInitializer.onStartup(SpringApplicationWebApplicationInitializer.java:48)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5178)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more

01-Mar-2019 10:33:10.033 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\MyApp.war
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyApp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
01-Mar-2019 10:33:10.033 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\LineRegister.war has finished in 15,127 ms
01-Mar-2019 10:33:10.033 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\docs
01-Mar-2019 10:33:10.043 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'debug' to '0' did not find a matching property.
01-Mar-2019 10:33:10.043 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'distributable' to 'false' did not find a matching property.
01-Mar-2019 10:33:10.063 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\docs has finished in 30 ms
01-Mar-2019 10:33:10.063 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\examples
01-Mar-2019 10:33:10.063 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'debug' to '0' did not find a matching property.
01-Mar-2019 10:33:10.063 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'distributable' to 'false' did not find a matching property.
01-Mar-2019 10:33:10.353 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\examples has finished in 290 ms
01-Mar-2019 10:33:10.353 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\host-manager
01-Mar-2019 10:33:10.353 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'debug' to '0' did not find a matching property.
01-Mar-2019 10:33:10.353 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'distributable' to 'false' did not find a matching property.
01-Mar-2019 10:33:10.373 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\host-manager has finished in 20 ms
01-Mar-2019 10:33:10.373 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager
01-Mar-2019 10:33:10.373 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'debug' to '0' did not find a matching property.
01-Mar-2019 10:33:10.373 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'distributable' to 'false' did not find a matching property.
01-Mar-2019 10:33:10.403 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager has finished in 30 ms
01-Mar-2019 10:33:10.403 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT
01-Mar-2019 10:33:10.403 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'debug' to '0' did not find a matching property.
01-Mar-2019 10:33:10.403 WARNING [localhost-startStop-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Context/Manager} Setting property 'distributable' to 'false' did not find a matching property.
01-Mar-2019 10:33:10.423 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT has finished in 20 ms
01-Mar-2019 10:33:10.423 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
01-Mar-2019 10:33:10.423 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
01-Mar-2019 10:33:10.423 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 15558 ms

On Thursday, February 28, 2019 at 4:47:45 PM UTC+1, Justin Miranda wrote:
Is that all you see in the log? If not, can you include the entire log? 

Without more information my guess would be that this is a Tomcat dependency issue (i.e. there's an embedded Tomcat dependency in the WAR that needs to be removed)

On Thu, Feb 28, 2019 at 8:53 AM Joud <joud.k...@gmail.com> wrote:
Hi all, am trying to deploy my grails 3 app into tomcat 8.5.. When opening my app, I get HTTP Status 404 error and in the log I get this:

SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\MyApp.war
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MyApp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any idea what might be the cause?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.

Daniel Leahy

unread,
Mar 1, 2019, 4:57:06 AM3/1/19
to Grails Dev Discuss
What version of Grails are you using?





On Thursday, 28 February 2019 14:53:50 UTC, Joud wrote:

Joud

unread,
Mar 1, 2019, 4:59:10 AM3/1/19
to Grails Dev Discuss
Yes my app runs perfectly from command line. and I have a direct oracle datasource configured as follows:
dataSource {
    dbCreate = "none"
url = "----------------"
driverClassName = "oracle.jdbc.OracleDriver"
dialect = org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect
username = "username
password = "pwd"

Joud

unread,
Mar 1, 2019, 5:06:20 AM3/1/19
to Grails Dev Discuss
Grails 3.3.8

Joud

unread,
Mar 1, 2019, 5:12:32 AM3/1/19
to Grails Dev Discuss
I saw some threads mentioning that it might be because of groovy-ant dependency, I tried even removing it all but still the same issue.

Joud

unread,
Mar 1, 2019, 6:00:30 AM3/1/19
to Grails Dev Discuss
Any idea? Any hint would be highly appreciated


On Friday, March 1, 2019 at 10:57:06 AM UTC+1, Daniel Leahy wrote:

Daniel Leahy

unread,
Mar 1, 2019, 6:04:25 AM3/1/19
to Grails Dev Discuss
Hi Joud,
                 i just created a brand new Grails 3.3.8 application/war and deployed it on a local instance of 

Apache Tomcat/8.5.38

with no issue.


I didn't even change the build dependency for the built in tomcat dependency

I am working on a windows 10 machine


What i would do is create a brand new grails app , create the war from that and try and deploy that.

I am assuming you're using the web profile in your grails app.

If that works, add in any additional dependencies one by one until you discover which dependency is causing the issue.

Regards,
                Daniel Leahy.










 

On Thursday, 28 February 2019 14:53:50 UTC, Joud wrote:
Reply all
Reply to author
Forward
0 new messages