szquadri / javamelody

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

Java 1.5, JavaMelody 1.49 gives java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException #383

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use JavaMelody 1.49 with Java 1.5.0_22 and Tomcat 5.5.36. According to 
documentation Java 1.5 is supported.

What is the expected output? What do you see instead?
In tomcat logs I see:
java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
    at net.bull.javamelody.MonitoringFilter.createRequestWrapper(MonitoringFilter.java:275)
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:188)
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:881)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:674)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:541)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:595)

This class does not exists in Java 1.5. It was introduced in later versions. Of 
course there is some other bug that throws this exception but
we will see what is it when thia exception problem is corrected.
I did another test on Tomcat 7 and Java 1.7 and it works fine, but in 
production we have Java 1.5 and Tomcat 5.5.36.

What version of the product are you using? On what application server, JDK, 
operating system?
JavaMelody: 1.49
Tomcat: 5.5.36
Java JDK: 1.5.0_22
Windows XP SP 3 (my workstation), in production we have IBM AIX and IBM Java so 
it may couse other problems, but well see whet we get there.

Please provide any additional information below.

Original issue reported on code.google.com by gstac...@poczta.fm on 18 Feb 2014 at 7:36

GoogleCodeExporter commented 9 years ago
I did another test. Same exception is thrown with JavaMelody 1.48, but with 
1.47 it works fine.

Original comment by gstac...@poczta.fm on 18 Feb 2014 at 7:54

GoogleCodeExporter commented 9 years ago
What happens if you add the following jar file in your classpath (/WEB-INF/lib/ 
directory in your webapp)?
http://search.maven.org/remotecontent?filepath=javax/xml/stream/stax-api/1.0-2/s
tax-api-1.0-2.jar

If you use Maven in your project, you can add the following dependency in your 
pom.xml file to add the jar file:
<dependency>
   <groupId>javax.xml.stream</groupId>
   <artifactId>stax-api</artifactId>
   <version>1.0-2</version>
</dependency>

Original comment by evernat@free.fr on 22 Feb 2014 at 7:53

GoogleCodeExporter commented 9 years ago
Everything works with stax-api-1.0-2.jar

Original comment by gstac...@poczta.fm on 24 Feb 2014 at 2:06

GoogleCodeExporter commented 9 years ago
This is certainly caused by your IBM java, which class loading is quite 
special. (It is known to try to load classes, when Oracle java does not try to 
because it does not need to, at least not yet.)

Given that it's IBM java and given that the issue is only in Java 1.5 (quite 
old and even EOL), this issue is won't fix here.
I suggest that you keep the stax-api jar file [1] in your classpath 
(/WEB-INF/lib/ directory in your webapp), or even better that you upgrade your 
java version.

[1] 
http://search.maven.org/remotecontent?filepath=javax/xml/stream/stax-api/1.0-2/s
tax-api-1.0-2.jar

Original comment by evernat@free.fr on 17 Mar 2014 at 12:53

GoogleCodeExporter commented 9 years ago
As I said, this error is thrown on my workstation with Windows XP SP 3,
JavaMelody: 1.49 and 1.48
Tomcat: 5.5.36
Java JDK: 1.5.0_22

But works with JavaMelody 1.47.

In production we have IBM AIX and IBM Java. We're using JavaMelody 1.47 there, 
and it works fine.

Original comment by gstac...@poczta.fm on 2 Apr 2014 at 7:48