Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session serialization and deserialization fails under Tomcat with an advised and session-scoped bean [SPR-10972] #15600

Closed
spring-projects-issues opened this issue Oct 9, 2013 · 3 comments
Labels
in: core status: bulk-closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 9, 2013

Michał Politowski opened SPR-10972 and commented

In a webapp run under Tomcat there is a session-scoped bean which is also the target of advice.
When Tomcat is being shut down it logs a warning (logged from a reproduction project, with -Dsun.io.serialization.extendedDebugInfo=true):

09-Oct-2013 12:33:01 org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute scopedTarget.component for session 2FC40E979D1454DB9B01A288CF06C56F
java.io.NotSerializableException: org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl
	- element of array (index: 1)
	- array (class "[Lorg.springframework.aop.Advisor;", size: 2)
	- field (class "org.springframework.aop.framework.AdvisedSupport", name: "advisorArray", type: "class [Lorg.springframework.aop.Advisor;")
	- object (class "org.springframework.aop.framework.ProxyFactory", org.springframework.aop.framework.ProxyFactory: 0 interfaces []; 2 advisors [org.springframework.aop.interceptor.ExposeInvocationInterceptor.ADVISOR, InstantiationModelAwarePointcutAdvisor: expression [@annotation(org.springframework.issues.AdivseMe) && this(c)]; advice method [public void org.springframework.issues.ComponentAspect.doSomething(org.springframework.issues.ScopedComponent)]; perClauseKind=SINGLETON]; targetSource [SingletonTargetSource for target object [org.springframework.issues.ScopedComponent@101d01]]; proxyTargetClass=false; optimize=false; opaque=false; exposeProxy=false; frozen=false)
	- field (class "org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor", name: "advised", type: "class org.springframework.aop.framework.AdvisedSupport")
	- object (class "org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor", org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor@178feba)
	- field (class "org.springframework.issues.ScopedComponent$$EnhancerByCGLIB$$b0bb4729", name: "CGLIB$CALLBACK_0", type: "interface org.springframework.cglib.proxy.MethodInterceptor")
	- root object (class "org.springframework.issues.ScopedComponent$$EnhancerByCGLIB$$b0bb4729", org.springframework.issues.ScopedComponent@101d01)

and, what's worse, when starting again sesion deserialization fails for the same reason:

SEVERE: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl
	- element of array (index: 1)
	- array (class "[Lorg.springframework.aop.Advisor;", size: 2)
	- field (class "org.springframework.aop.framework.AdvisedSupport", name: "advisorArray", type: "class [Lorg.springframework.aop.Advisor;")
	- object (class "org.springframework.aop.framework.ProxyFactory", org.springframework.aop.framework.ProxyFactory: 0 interfaces []; 2 advisors [org.springframework.aop.interceptor.ExposeInvocationInterceptor.ADVISOR, InstantiationModelAwarePointcutAdvisor: expression [@annotation(org.springframework.issues.AdivseMe) && this(c)]; advice method [public void org.springframework.issues.ComponentAspect.doSomething(org.springframework.issues.ScopedComponent)]; perClauseKind=SINGLETON]; targetSource [SingletonTargetSource for target object [org.springframework.issues.ScopedComponent@101d01]]; proxyTargetClass=false; optimize=false; opaque=false; exposeProxy=false; frozen=false)
	- field (class "org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor", name: "advised", type: "class org.springframework.aop.framework.AdvisedSupport")
	- object (class "org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor", org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor@178feba)
	- field (class "org.springframework.issues.ScopedComponent$$EnhancerByCGLIB$$b0bb4729", name: "CGLIB$CALLBACK_0", type: "interface org.springframework.cglib.proxy.MethodInterceptor")
	- root object (class "org.springframework.issues.ScopedComponent$$EnhancerByCGLIB$$b0bb4729", org.springframework.issues.ScopedComponent@101d01)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)

Affects: 3.2.4

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 9, 2013

Michał Politowski commented

Created a pull request for the reproduction project I used.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 10, 2013

@spring-projects-issues spring-projects-issues added type: bug status: waiting-for-triage in: core and removed type: bug labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed and removed status: waiting-for-triage labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: bulk-closed
Projects
None yet
Development

No branches or pull requests

2 participants