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

Gradle Daemon - Caused by: java.lang.Error: factory already defined #187

Open
sgoldstein527 opened this issue Jul 27, 2019 · 2 comments
Open

Comments

@sgoldstein527
Copy link

When using the Gradle daemon (the default), I'm unable to run Tomcat twice using the plugin. The first time it starts, there is no problem. I then run "gradle tomcatStop" followed by "gradle tomcatRun" to restart Tomcat. I get the error/stacktrace below. If I run, "gradle --stop" to stop the gradle daemon, I'm once again able to run "gradle tomcatRun" successfully.

I'm using the plugin version 2.5 and Tomcat version 9.0.22.

Caused by: java.lang.Error: factory already defined
at java.base/java.net.URL.setURLStreamHandlerFactory(URL.java:1184)
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.(TomcatURLStreamHandlerFactory.java:130)
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.getInstanceInternal(TomcatURLStreamHandlerFactory.java:53)
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.register(TomcatURLStreamHandlerFactory.java:77)
at org.apache.catalina.webresources.StandardRoot.registerURLStreamHandlerFactory(StandardRoot.java:701)
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:683)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 175 more

@C-Otto
Copy link

C-Otto commented Aug 3, 2020

Workaround: ./gradlew tomcatRun --no-daemon

@danieljeremias
Copy link

Is threre a real solution for this case?

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

3 participants