Question & Answer
Question
Troubleshooting tips for java.io.NotSerializableException error messages when dynamic caching is enabled *|* -7D7F3372F30956E28525796B00209A5A- *|*
Answer
Technote (troubleshooting)
Problem(Abstract)
java.io.NotSerializableException message fills up log files when dynamic caching is enabled with diskoffload and/or cache replication is enabled.
Symptom
The following exception is seen excessively in the logs:
CacheEntry E DYNA0052E: The cached object can not be replicated or saved to disk.
CacheID=<JSP_Path>/SomeJSP.jsp:storeId=12345:productId=:UTF-8:requestType=GET
ClassName=com.ibm.ws.cache.servlet.FragmentComposerMemento
Exception=java.io.NotSerializableException:com.ibm.commerce.command.ViewCommandContextImpl
Cause
An attempt is made to either replicate or cache non-Serializable data on disk.
The exception shown above is most likely caused by caching of attributes which are not Serializable.
Resolving the problem
First determine the WebSphere Application Server (WAS) version and Fix Pack level.
1) If your environment is on a lower Fix Pack than WAS V6.0.2.19 refer to the following technote: NotSerializableException thrown when using dynacache with WebSphere Commerce.
2) If your environment is WAS V6.0.2.19 and higher or WAS V7.0 double check to ensure the Step 3 in the above technote has been completed to enable the fix.
If the errors still persist in the logs examine the caching policy for SomeJSP.jsp reported in the error message above. The caching policy for this JSP can be found in the <WC_EAR_dir>/Stores.war/WEB-INF/cachespec.xml file.
Specifically examine the "save-attributes" property for SomeJSP.jsp's cache entry.
If "save-attributes" property is set to "true" revert the value to "false". This will prevent caching of the attributes some of which may not be Serializable.
For example
Change From:
<cache-entry>
<class>servlet</class>
<name><JSP_Path>/SomeJSP.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">true</property>
<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
..
..
</cache-id>
Change To:
<cache-entry>
<class>servlet</class>
<name><JSP_Path>/SomeJSP.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">false</property>
<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
..
..
</cache-id>
If any attributes are explicitly being cached disable the caching of these attributes. This will prevent the caching of the attributes which are not Serializable.
Change From:
<cache-entry>
<class>servlet</class>
<name><JSP_Path>/SomeJSP.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">false</property>
<exclude>someAttribute1</exclude>
<exclude>someAttribute2</exclude>
..
..
<exclude>someAttributeN</exclude>
<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
..
..
</cache-id>
Change To:
<cache-entry>
<class>servlet</class>
<name><JSP_Path>/SomeJSP.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">false</property>
<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
..
..
</cache-id>
Was this topic helpful?
Document Information
More support for:
Sterling Total Payments for Financial Services
Software version:
All Versions
Document number:
767269
Modified date:
12 October 2021
UID
ibm10767269