Search code examples
multithreadingjsfruntimewebspherecluster-computing

Clustered environment on Websphere asking me to make the application module "Serializable at runtime", how to fix it?


My JSF application is perfectly fine in Development environment which is non clustered Websphere server environment.

But once I deploy it on a clustered environment , I keep getting this error. I'm not sure why.
What change is it recommending?

00000031 WASSession    E SessionContextMBeanAdapter findAttCausingNotSerializableException 
Miscellaneous data: Attribute "searchParty" is declared to be serializable but is
found to generate exception "java.io.NotSerializableException" with message
"org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureEList".  
Fix the application so that the attribute "searchParty" is correctly 
serializable at runtime.

Solution

  • This error says that in the HttpSession you store object that is not serializable. In your case it is searchParty item contains some filed of type org.eclipse.emf.ecore.util.FeatureMapUtil, which is not serializable.

    Error is most probably generated by PMI counter session size - see the following technote Getting java.io.NotSerializableException when SessionObjectSize counter is enabled

    You have two solutions:

    • if you plan to use persistent sessions, and replication across the cluster, code needs to be fixed to be serializable (change that field or make it transient)
    • if you will not use persistent sessions you may disable session size counter in the PMI to get rid of that error.