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

InitDestroyAnnotationBeanPostProcessor should have static logger because it's Serializable [SPR-5962] #10630

Closed
spring-projects-issues opened this issue Jul 28, 2009 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Mike Youngstrom opened SPR-5962 and commented

We are using Commons Logger over SLF4J. Commons Logger over SLF4J doesn't appear to serialize its Log implementation correctly. That has exposed the NPE bellow when our app runs in a clustered environment. Although I will log an issue with SLF4J I also thought I would log an issue here as well as I believe a static Log reference would serve InitDestroyAnnotationBeanPostProcessor better than a member variable to help reduce serialized size.

[7/28/09 0:14:32:226 MDT] 0000005a SystemErr R java.lang.NullPointerException
[7/28/09 0:14:32:226 MDT] 0000005a SystemErr R at org.apache.commons.logging.impl.SLF4JLocationAwareLog.isDebugEnabled(SLF4JLocationAwareLog.java:59)
[7/28/09 0:14:32:226 MDT] 0000005a SystemErr R at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:201)
[7/28/09 0:14:32:226 MDT] 0000005a SystemErr R at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:182)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeDestruction(InitDestroyAnnotationBeanPostProcessor.java:160)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:140)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at org.springframework.beans.factory.support.DisposableBeanAdapter.run(DisposableBeanAdapter.java:134)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at org.springframework.web.context.request.ServletRequestAttributes$DestructionCallbackBindingListener.valueUnbound(ServletRequestAttributes.java:269)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionData.processListeners(SessionData.java:924)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionData.checkSwappableListeners(SessionData.java:564)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.DatabaseSessionData.checkSwappableListeners(DatabaseSessionData.java:331)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionData.sessionUnbound(SessionData.java:997)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionContext.notifySessionInvalidated(SessionContext.java:1100)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionData.invalidate(SessionData.java:621)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.SessionData.internalInvalidate(SessionData.java:586)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.DRSSessionData.internalInvalidate(DRSSessionData.java:252)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.webcontainer.httpsession.HttpSessDRSCacheMsgListener.response(HttpSessDRSCacheMsgListener.java:524)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.drs.stack.DRSClientCallback.processRcvMessage(DRSClientCallback.java:393)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.drs.stack.DRSStack.processRcvMessage(DRSStack.java:295)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.drs.DRSDomain.messageReceived(DRSDomain.java:536)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.drs.ha.DRSAgentClassEvents$1.run(DRSAgentClassEvents.java:714)
[7/28/09 0:14:32:227 MDT] 0000005a SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)


Affects: 2.5.6

Referenced from: commits 9508f41

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I made InitDestroyAnnotationBeanPostProcessor's logger field transient, restoring it on deserialization. Keeping it as an instance variable preserves the log going into the same category when called from CommonAnnotationBeanPostProcessor.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants