Coder Social home page Coder Social logo

Comments (5)

bmuschko avatar bmuschko commented on June 3, 2024

Thanks for providing a detailed description and sample project. Looks like this coming from the Tomcat internals. I'd have to investigate on this. I remember that my plugin code had to slightly change the JAR scanning behavior. That might have caused a side-effect.

from gradle-tomcat-plugin.

bmuschko avatar bmuschko commented on June 3, 2024

Is this still a problem with the latest version of the plugin? Please also avoid using the method Task#execute. You find a better way to make your scenario work in the FAQ of the plugin (using finalizedBy).

from gradle-tomcat-plugin.

davidnortonjr avatar davidnortonjr commented on June 3, 2024

Ben, it works great for me now, thanks!

from gradle-tomcat-plugin.

davidnortonjr avatar davidnortonjr commented on June 3, 2024

Thank you also for the finalizedBy tip.

from gradle-tomcat-plugin.

benoitlouy avatar benoitlouy commented on June 3, 2024

I am having the same issue using gradle 2.4, the latest version of the plugin (2.2.2) and having changed the test task to use dependsOn and finializedBy to start and stop tomcat.
I forked @davidnortonjr repo and updated it with these changes.

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

from gradle-tomcat-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.