java.io.NotSerializableException | Jboss Cluster

Jboss or Wildfly
2010-04-06 20:42:27,659 DEBUG [org.jboss.web.tomcat.service.session.JvmRouteValve] checkJvmRoute(): check if need to re-route based on JvmRoute. Session id: FC91F8624A71CD108B31692F96827946.node1 jvmRoute: node1
2010-04-06 20:42:27,665 ERROR [org.jboss.web.tomcat.service.session.JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: FC91F8624A71CD108B31692F96827946.node1 lastAccessedTime: 1270566747344 version: 5 lastOutdated: 0]
java.io.NotSerializableException: java.util.PropertyResourceBundle
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.HashMap.writeObject(HashMap.java:1001)
at sun.reflect.GeneratedMethodAccessor146.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)

2010-04-06 20:42:27,678 DEBUG [org.jboss.web.tomcat.service.session.JvmRouteValve] checkJvmRoute(): check if need to re-route based on JvmRoute. Session id: FC91F8624A71CD108B31692F96827946.node1 jvmRoute: node1
2010-04-06 20:42:27,679 ERROR [org.jboss.web.tomcat.service.session.JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: FC91F8624A71CD108B31692F96827946.node1 lastAccessedTime: 1270566747659 version: 6 lastOutdated: 0]
java.io.NotSerializableException: java.util.PropertyResourceBundle
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.HashMap.writeObject(HashMap.java:1001)
at sun.reflect.GeneratedMethodAccessor146.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)

 

Above exception usually occurs when session replication is enabled and the objects in session are not Serializable .Usually its a coding mistake/skip where we don’t put extends serializable.

Examples:

public interface javax.ejb.EnterpriseBean
extends java.io.Serializable
{
}

public interface Bar {
void doBar() throws BarException;
}

public interface Foo extends Bar, Serializable {
void doFoo() throws FooException;
}

public class Blah implements Foo {
public void doBar() throws BarException {};
public void doFoo() throws FooException {};
}

You can try one option in JAVA_OPTS i.e -Dsession.serialization.jboss=false

If session replication is not required then this error/exception can be avoided by removing <distributable /> tag in web.xml file of WAr file. But this is not a suggested method. Best method is to make all code serializable.

 

If above does not solve the issue then you can follow below links to find your probable solution:

Try below urls also:

1. High Availability Enterprise Services via JBoss Clusters
2. HTTP Clustering and Load Balancing
3. cannot retrieve variable in anasynchronous node
4. Using JBossSerialization with HttpSession Replication
6. externalizeSession(): exception

 

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.