InvalidClassException error while deserializing session data

偶尔善良 提交于 2020-01-03 03:14:08

问题


Here is the calling code:

Object attribute = session.getAttribute(name, scope);

and this throws the following eror:

Could not deserialize session data.
java.io.InvalidClassException: org.apache.commons.lang.time.FastDateFormat; local class  incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -7186497712641044641

The environment is Weblogic. The Web application is a spring portlet. I'm trying to understand how to fix this issue.


回答1:


Had to add the commons-lang to the "preferred application packages" section of weblogic.xml to get this fixed.

<container-descriptor>
    <prefer-application-packages>
        <package-name>org.apache.commons.lang.*</package-name>
    </prefer-application-packages>
    <optimistic-serialization>true</optimistic-serialization>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</container-descriptor>


来源:https://stackoverflow.com/questions/20338125/invalidclassexception-error-while-deserializing-session-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!