Skip to content

web-application crashing when setting a non-serializable object into session [SPR-11168] #15794

@spring-projects-issues

Description

@spring-projects-issues

J John opened SPR-11168 and commented

I upgraded spring versions of a spring-portlet-mvc application from 3.1.4.RELEASE to 3.25.RELEASE. And i am getting following exception, when ever trying to set a non-serializable object into portlet-session or servlet-session

[#|2013-12-04T17:19:05.122+0200|INFO|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=157;_ThreadName=http-thread-pool-4270(3);|17:19:05,113 ERROR [CustomSimpleMappingExceptionResolver:109] An unexpected error occured. Redirecting to the error page.
java.lang.IllegalArgumentException: PWC2788: setAttribute: Non-serializable attribute with name FOO_BAR
        at org.apache.catalina.session.ManagerBase.checkSessionAttribute(ManagerBase.java:832)
        at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1713)
        at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:178)
        at com.liferay.portal.servlet.SharedSessionWrapper.setAttribute(SharedSessionWrapper.java:161)
        at com.liferay.portlet.PortletSessionImpl.setAttribute(PortletSessionImpl.java:279)
        at example.ExampleController.helloWorld(ExampleController.java:48)

My Application is running on a LiferayPortal-6.1 running on a Glassfish-3.1 server

The fix for https://jira.springsource.org/browse/SPR-10219 is causing this issue. The fix added <distributable/> tag in spring-web/src/main/resources/META-INF/web-fragment.xml, which may be making the whole application distributable and thus mandating all session-objs to be serializable.


Affects: 3.2.5

Reference URL: http://forum.spring.io/forum/spring-projects/web/737218-web-application-crashing-when-setting-a-non-serializable-object-into-session?_=1386223570874&_=1386224884459

Issue Links:

2 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions