cangwolf / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Using JavaMelody in a Gradle embedded Tomcat container produces a ClassCircularityError #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check out the minimal Gradle/JavaMelody project at 
https://github.com/chronodm/gtp-96
2. In the project directory, invoke ./gradlew --stacktrace tomcatRun

What is the expected output?

- The app starts normally, without errors

What do you see instead?

- A stacktrace, of which the relevant section is:

Caused by: java.lang.ClassCircularityError: java/util/logging/LogRecord
    at net.bull.javamelody.LoggingHandler.publish(LoggingHandler.java:109)
    at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:183)
    at org.apache.juli.logging.DirectJDKLog.debug(DirectJDKLog.java:106)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:369)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:341)
    at org.apache.catalina.startup.Tomcat$start.call(Unknown Source)
    at org.gradle.api.plugins.tomcat.embedded.BaseTomcatServerImpl.start(BaseTomcatServerImpl.groovy:37)

What version of the product are you using? On what application server, JDK,
operating system?

- JavaMelody 1.50.0, although it also occurs with 1.29.0 (I haven't sampled 
anything in between).
- Tomcat (embedded, via gradle-tomcat-plugin)
- JDK 1.6.0_38 (HotSpot 64-bit server VM)
- Linux Mint

Original issue reported on code.google.com by chronodm on 30 May 2014 at 11:00

GoogleCodeExporter commented 9 years ago
I do not think that this is a javamelody issue. You can certainly reproduce the 
same issue with your own ServletContextListener / Filter or Servlet, and using 
java.util.logging.* or SLF4J.

So it's probably a Tomcat or gradle-tomcat-plugin issue. Resolving as invalid 
here.

Just to help, I suggest to note the versions of gradle-tomcat-plugin, tomcat 
and of JDK in the initial issue.
Then I suggest to test recent versions of JDK and of Tomcat, this may change 
some things.

Original comment by evernat@free.fr on 1 Jun 2014 at 9:05

GoogleCodeExporter commented 9 years ago
I was not able to reproduce the issue without JavaMelody—I created a 
ServletFilter that logged all requests with java.util.logging and that worked 
fine. So something about the way JavaMelody uses logging, while not unique, is 
triggering this issue.

Original comment by chronodm on 1 Jun 2014 at 2:01

GoogleCodeExporter commented 9 years ago
FWIW, I'm using the latest version of Tomcat 7 (7.0.54), and when I reran it 
with JDK 1.7.0_51 I got exactly the same error.

Original comment by chronodm on 2 Jun 2014 at 5:03