IBM Support

java.io.NotSerializableException when calling the method getSessionContext().getTimerService().createTimer(theTimerServiceInterval, theTimerServiceInterval, theTimerInfo) under WebSphere v8

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.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"EJB Container","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"},{"code":"PF010","label":"HP-UX"},{"code":"PF002","label":"AIX"},{"code":"PF027","label":"Solaris"}],"Version":"8.0;8.5;8.5.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21656692