1 Reply Latest reply on Aug 26, 2008 1:59 AM by Srikanth Adapa

    Generating a NotSerializableException

    Srikanth Adapa Newbie

      Hi all,

      I want to give clustering support for a small application and it was not successfully done and is generating the following exception stack trace.

      java.io.NotSerializableException: nextapp.echo2.webrender.Connection
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1527)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1492)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1410)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1168)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1527)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1492)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1410)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1168)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
      at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1284)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:623)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:963)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1479)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1410)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1168)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
      at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
      at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
      at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
      at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121)
      at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
      at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
      at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
      at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
      at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:675)



      Please let me know how is this ObjectOutputStream.java is stopping something to be Serialized.


      Thank you in advance!!

      Sri..

        • 1. Re: Generating a NotSerializableException
          Srikanth Adapa Newbie

          Hi all,
          As I have observered that the "Connection" is not serialized, I ve modified that. And now, I found a new Exception stack trace:

          11:22:51,362 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: jFdwj9uBb2SnaFbZjiTSaQ**.node1 lastAccessedTime: 1219729960683 version: 17 lastOutdated: 0]
          java.io.NotSerializableException: org.apache.catalina.connector.RequestFacade
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
          at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
          at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1247)
          at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
          at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
          at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
          at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
          at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
          at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
          at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121)
          at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
          at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
          at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
          at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
          at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
          at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
          at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
          at java.lang.Thread.run(Thread.java:619)



          Please discuss and continue the discussion , If anyone identified this


          Thank you!

          Sri