简体   繁体   中英

InvalidClassException error while deserializing session data

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM