5608057 / javamelody

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

ClassNotFoundException when serializing session breaks the sessions view #355

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use Drools in your project, but without the optional dependency: protobuf
2. Have a certain Drools object in the session somehow (I'm not sure which 
object, probably an implementation of StatefulKnowledgeSession).
3. Visit the http sessions page
4. Visit an individual session page

What is the expected output? What do you see instead?
Session size should be -1 (unknown, can't serialize).  Instead, the sessions 
page is blank, and an error is logged by the app server. (See below.)

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

JBoss EAP 6.1.0.GA, OpenJDK 1.7.0_25, RHEL 6.4

Please provide any additional information below.

The method net.bull.javamelody.SessionInformations.getObjectSize(Object) 
catches IOException and returns -1, but it does not catch other exceptions.

java.lang.ClassNotFoundException: com.google.protobuf.Message from [Module 
"deployment.zanata.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]
    at org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:169) [drools-core-5.3.3.Final.jar:5.3.3.Final]
    at org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:151) [drools-core-5.3.3.Final.jar:5.3.3.Final]
    at org.drools.reteoo.ReteooStatefulSession.writeExternal(ReteooStatefulSession.java:117) [drools-core-5.3.3.Final.jar:5.3.3.Final]
    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1456) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1427) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1541) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1506) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_25]
    at java.util.ArrayList.writeObject(ArrayList.java:710) [rt.jar:1.7.0_25]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175) [rt.jar:1.7.0_25]
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_25]
    at net.bull.javamelody.SessionInformations.getObjectSize(SessionInformations.java:281) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.SessionInformations.computeSerializedSize(SessionInformations.java:207) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.SessionInformations.<init>(SessionInformations.java:159) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.SessionListener.getAllSessionsInformations(SessionListener.java:163) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.HtmlController.doSessions(HtmlController.java:173) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.HtmlController.doHtmlPartForSystemActions(HtmlController.java:145) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.HtmlController.doHtmlPart(HtmlController.java:138) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.HtmlController.doHtml(HtmlController.java:101) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringController.doCompressedHtml(MonitoringController.java:235) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringController.doReportCore(MonitoringController.java:192) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringController.doReport(MonitoringController.java:180) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringController.doActionIfNeededAndReport(MonitoringController.java:138) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringFilter.doMonitoring(MonitoringFilter.java:334) [javamelody-core-1.41.0.jar:1.41.0]
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:170) [javamelody-core-1.41.0.jar:1.41.0]
    at org.zanata.seam.interceptor.MonitoringWrapper.doFilter(MonitoringWrapper.java:66) [classes:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.zanata.servlet.GWTCacheControlFilter.doFilter(GWTCacheControlFilter.java:61) [classes:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.zanata.servlet.MDCInsertingServletFilter.doFilter(MDCInsertingServletFilter.java:58) [classes:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.jboss.security.negotiation.NegotiationAuthenticator$1.invoke(NegotiationAuthenticator.java:326) [jboss-negotiation-common-2.2.2.Final.jar:2.2.2.Final]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:389) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

Original issue reported on code.google.com by sean.flanigan@gmail.com on 25 Oct 2013 at 3:48

GoogleCodeExporter commented 8 years ago
It's fixed in trunk (revision 3550) and ready for the next release (1.48).

I have made a new build from trunk and it is available at:
https://javamelody.googlecode.com/files/javamelody-20131028.jar

Thanks

Original comment by evernat@free.fr on 28 Oct 2013 at 10:35