1 Reply Latest reply on May 22, 2008 11:11 AM by Brian Stansberry

    Back to jboss clustering

    praveena chalamcharla Newbie

      Hi,
      I am again back to the forum for clarifying a doubt. I want to remind you once again that I have used Hibernate and Echo2 for developing my application war file maintaining a postgres database at the back end. It was fit and fine when running on Tomcat. Currently we are planning to clustering support and started working with Jboss. A single Jboss server is also giving good result. The issue is coming when implementing clustering. Please find the error console with the stack trace:

      As Jboss could be clustered properly when normal wars containing simple jsp's are deployed(with out using ECHO2 application) , So the issue might be with ECHO2. But I have some doubts. So, please check the issue once.


      19:26:13,194 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: E77D5F675682BDF03530D52F4014AC40.node2 lastAccessedTime: 1211464563645 version: 16 lastOutdated: 0]
      java.io.NotSerializableException: org.apache.catalina.connector.RequestFacade
      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 nextapp.echo2.app.event.EventListenerList.writeObject(EventListenerList.java:187)
      at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.ArrayList.writeObject(ArrayList.java:674)
      at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
      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.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.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)


      I have the knowledge that Jboss use Tomcat web container for running the war files.
      I want to know about the RequestFacade.java file which I found in the Tomcat source code at org.apache.catalina.connector package to be non serialised. But, I could not find the file with in Jboss source code any where. Now I am not understanding from where the RequestFacade class is coming or how far is it reasonable to the raise of the exception. Or let me know if it was internally embeded in the Jboss jars.
      And also please make me sure that how far tomcat is responsible while Jboss is deploying a war file.

        • 1. Re: Back to jboss clustering
          Brian Stansberry Master

          You are attempting to serialize a session whose attribute map includes an object that is not serializable (RequestFacade). RequestFacade is the Tomcat implementation of HttpServletRequest -- mostly likely somewhere in your code you are storing a reference to the HttpServletRequest in some object and then placing that object in the session. That won't work for a clustered session, which needs to be serializable.

          Look at the usage of the nextapp.echo2.app.event.EventListenerList class. The stack trace shows that the RequestFacade is being serialized as part of an object graph that includes that class.