Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Cannot start Tomcat more than once. #124

Open
benoitlouy opened this issue Jun 4, 2015 · 1 comment
Open

Cannot start Tomcat more than once. #124

benoitlouy opened this issue Jun 4, 2015 · 1 comment

Comments

@benoitlouy
Copy link

Same issue than #46 but I'm using gradle 2.4, the latest version of the plugin (2.2.2) and dependsOn and finalizedBy to start and stop tomcat.

You can reproduce the issue by using the code located there https://github.com/benoitlouy/gradle-tomcat-plugin-run-tomcat-twice-issue and running ./gradlew :web:war integrationTest

I get the following output:

:web:compileJava UP-TO-DATE
:web:compileGroovy UP-TO-DATE
:web:processResources UP-TO-DATE
:web:classes UP-TO-DATE
:web:war
:integration-tests:mode-a:compileJava UP-TO-DATE
:integration-tests:mode-a:compileGroovy UP-TO-DATE
:integration-tests:mode-a:processResources UP-TO-DATE
:integration-tests:mode-a:classes UP-TO-DATE
:integration-tests:mode-a:war
:integration-tests:mode-a:integrationTomcatStart
Started Tomcat Server
The Server is running at http://localhost:8080/mode-a
:integration-tests:mode-a:compileTestJava UP-TO-DATE
:integration-tests:mode-a:compileTestGroovy UP-TO-DATE
:integration-tests:mode-a:processTestResources UP-TO-DATE
:integration-tests:mode-a:testClasses UP-TO-DATE
:integration-tests:mode-a:integrationTest UP-TO-DATE
:integration-tests:mode-a:integrationTomcatStop
:integration-tests:mode-b:compileJava UP-TO-DATE
:integration-tests:mode-b:compileGroovy UP-TO-DATE
:integration-tests:mode-b:processResources UP-TO-DATE
:integration-tests:mode-b:classes UP-TO-DATE
:integration-tests:mode-b:war
:integration-tests:mode-b:integrationTomcatStart
A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/mode-b]]
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        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:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/mode-b]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        ... 6 more
Caused by: java.lang.IllegalStateException: Illegal class loader binding
        at org.apache.naming.resources.DirContextURLStreamHandler.get(DirContextURLStreamHandler.java:228)
        at org.apache.naming.resources.DirContextURLStreamHandler.openConnection(DirContextURLStreamHandler.java:90)
        at java.net.URL.openConnection(URL.java:971)
        at sun.net.www.protocol.jar.JarURLConnection.<init>(JarURLConnection.java:84)
        at sun.net.www.protocol.jar.Handler.openConnection(Handler.java:41)
        at java.net.URL.openConnection(URL.java:971)
        at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:258)
        at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:177)
        at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1902)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1272)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more
@jeanbza
Copy link

jeanbza commented Aug 4, 2015

Bump - also seeing this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants