Reputation: 311
I have a project at Heroku where I use JAVA 10, SPRING BOOT, GRADLE.
My Procfile: web: java -jar build/server/webapp-runner-*.jar build/libs/*.war
My system.properties: java.runtime.version=10
I generated my app.war locally using gradle bootWar
with success.
After that, I deployed my app.war using
heroku war:deploy ./build/libs/app.war --app app-dev
I received no errors during the deploy, it was like a success, but when I saw my project logs, there was this error:
2019-02-15T02:38:42.796193+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar webapp-runner.jar ${WEBAPP_RUNNER_OPTS} --port 49161 ./build/libs/app.war`
2019-02-15T02:38:46.173244+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2019-02-15T02:38:46.177681+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2019-02-15T02:38:46.841993+00:00 app[web.1]: Expanding app.war into /app/target/tomcat.49161/webapps/expanded
2019-02-15T02:38:46.842041+00:00 app[web.1]: Adding Context for /app/target/tomcat.49161/webapps/expanded
2019-02-15T02:38:47.269581+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.coyote.AbstractProtocol init
2019-02-15T02:38:47.269593+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-49161"]
2019-02-15T02:38:47.293324+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2019-02-15T02:38:47.293328+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2019-02-15T02:38:47.309720+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.catalina.core.StandardService startInternal
2019-02-15T02:38:47.309724+00:00 app[web.1]: INFO: Starting service [Tomcat]
2019-02-15T02:38:47.310472+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.catalina.core.StandardEngine startInternal
2019-02-15T02:38:47.310475+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.5.38
2019-02-15T02:38:47.708137+00:00 heroku[web.1]: State changed from starting to up
2019-02-15T02:38:47.652845+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2019-02-15T02:38:47.652860+00:00 app[web.1]: INFO: No global web.xml found
2019-02-15T02:38:47.858030+00:00 app[web.1]: Feb 15, 2019 2:38:47 AM org.apache.catalina.core.ContainerBase startInternal
2019-02-15T02:38:47.858034+00:00 app[web.1]: SEVERE: A child container failed during start
2019-02-15T02:38:47.858036+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2019-02-15T02:38:47.858037+00:00 app[web.1]: at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
2019-02-15T02:38:47.858039+00:00 app[web.1]: at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
2019-02-15T02:38:47.858041+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
2019-02-15T02:38:47.858043+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
2019-02-15T02:38:47.858045+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2019-02-15T02:38:47.858046+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
2019-02-15T02:38:47.858047+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
2019-02-15T02:38:47.858049+00:00 app[web.1]: at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2019-02-15T02:38:47.858050+00:00 app[web.1]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
2019-02-15T02:38:47.858052+00:00 app[web.1]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
2019-02-15T02:38:47.858053+00:00 app[web.1]: at java.base/java.lang.Thread.run(Thread.java:844)
2019-02-15T02:38:47.858055+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2019-02-15T02:38:47.858056+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2019-02-15T02:38:47.858058+00:00 app[web.1]: ... 6 more
2019-02-15T02:38:47.858060+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
2019-02-15T02:38:47.858061+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2200)
...
2019-02-15T02:41:23.000000+00:00 app[api]: Build started by user [email protected]
2019-02-15T02:41:42.591161+00:00 heroku[web.1]: State changed from crashed to starting
2019-02-15T02:41:42.407778+00:00 app[api]: Release v14 created by user [email protected]
2019-02-15T02:41:42.407778+00:00 app[api]: Deploy e565bff0 by user [email protected]
2019-02-15T02:41:42.000000+00:00 app[api]: Build succeeded
2019-02-15T02:41:49.312253+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar webapp-runner.jar ${WEBAPP_RUNNER_OPTS} --port 47389 ./build/libs/app.war`
2019-02-15T02:41:51.968104+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2019-02-15T02:41:51.972649+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2019-02-15T02:41:53.183680+00:00 app[web.1]: Expanding app.war into /app/target/tomcat.47389/webapps/expanded
2019-02-15T02:41:53.183878+00:00 app[web.1]: Adding Context for /app/target/tomcat.47389/webapps/expanded
2019-02-15T02:41:54.343385+00:00 app[web.1]: Feb 15, 2019 2:41:54 AM org.apache.coyote.AbstractProtocol init
2019-02-15T02:41:54.343399+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-47389"]
2019-02-15T02:41:54.374799+00:00 app[web.1]: Feb 15, 2019 2:41:54 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2019-02-15T02:41:54.374804+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2019-02-15T02:41:54.486332+00:00 app[web.1]: Feb 15, 2019 2:41:54 AM org.apache.catalina.core.StandardService startInternal
2019-02-15T02:41:54.486337+00:00 app[web.1]: INFO: Starting service [Tomcat]
2019-02-15T02:41:54.488366+00:00 app[web.1]: Feb 15, 2019 2:41:54 AM org.apache.catalina.core.StandardEngine startInternal
2019-02-15T02:41:54.488369+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.5.38
2019-02-15T02:41:54.926789+00:00 heroku[web.1]: State changed from starting to up
2019-02-15T02:41:55.309038+00:00 app[web.1]: Feb 15, 2019 2:41:55 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2019-02-15T02:41:55.309053+00:00 app[web.1]: INFO: No global web.xml found
2019-02-15T02:41:55.510365+00:00 app[web.1]: Feb 15, 2019 2:41:55 AM org.apache.catalina.core.ContainerBase startInternal
2019-02-15T02:41:55.510370+00:00 app[web.1]: SEVERE: A child container failed during start
2019-02-15T02:41:55.510372+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
What is the cause of this error?
Does anyone have any idea to solve this error?
Thanks for your attention.
Upvotes: 1
Views: 541
Reputation: 339
I hit the same problem too. After some trials and errors I found out that dependency on webapp-runner was included twice:
Removing the second reference (general dependency) to webapp-runner solved the issue. Though Gradle uses a bit different semantics from Maven, I guess the idea is the same.
Upvotes: 1