Troubleshooting
Problem
Getting java.io.NotSerializableException when attempting to serialize an instance of EJBContext or SessionContext via the Timer info
Symptom
When calling the method getSessionContext().getTimerService().createTimer(theTimerServiceInterval, theTimerServiceInterval, theTimerInfo) under WebSphere v8, the following exception can occur...
Caused by: java.io.NotSerializableException
at com.ibm.ejs.container.CMStatelessBeanO.writeObject(CMStatelessBeanO.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
Cause
This error means an attempt was made to serialize an instance of EJBContext or SessionContext via the Timer info, but these objects are not serializable per the EJB specification.
Resolving The Problem
This error means an attempt was made to serialize an instance of EJBContext or SessionContext via the Timer info, but these objects are not serializable per the EJB specification. Previous versions of the product inadvertently allowed them to be serialized, but changes made during development of EJB 3.1 in v8.0 now prevent the objects from being serialized. Developers should avoid serializing these instances.
If unsure which object is attempting to serialize the EJBContext or SessionContext, set the custom JVM property sun.io.serialization.extendedDebugInfo to true.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21656692