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

Condense exception messages accumulated through recursion [SPR-3708] #8389

Open
spring-projects-issues opened this issue Jul 20, 2007 · 2 comments
Labels
in: core type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 20, 2007

Antranig Basman opened SPR-3708 and commented

Spring currently generates exception traces which have text whose size will grow with the square of the bean fetch depth at which they occur - that is, since the "cause" exception message is printed out in full each time, each message includes the text at the next stack level which is a duplicate, and can become very hard to read. For example here is a message occuring at fetch depth 10:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TLABPostProcessorLoader' defined in class path resource [conf/rsf-config.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopeAlterationWrapperProxy' defined in class path resource [conf/rsf-config.xml]: Cannot create inner bean 'RSACBridgeProxy$child#9ffeb5' of type [uk.org.ponder.rsac.RSACBridgeProxy] while setting bean property 'value'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBridgeProxy$child#9ffeb5' defined in class path resource [conf/rsf-config.xml]: Cannot resolve reference to bean 'RSACBeanLocator' while setting bean property 'RSACBeanLocator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBeanLocator' defined in class path resource [conf/rsf-config.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentProcessorContributorParent$child' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFFixer' while setting bean property 'valueRef'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopeAlterationWrapperProxy' defined in class path resource [conf/rsf-config.xml]: Cannot create inner bean 'RSACBridgeProxy$child#9ffeb5' of type [uk.org.ponder.rsac.RSACBridgeProxy] while setting bean property 'value'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBridgeProxy$child#9ffeb5' defined in class path resource [conf/rsf-config.xml]: Cannot resolve reference to bean 'RSACBeanLocator' while setting bean property 'RSACBeanLocator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBeanLocator' defined in class path resource [conf/rsf-config.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentProcessorContributorParent$child' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFFixer' while setting bean property 'valueRef'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBridgeProxy$child#9ffeb5' defined in class path resource [conf/rsf-config.xml]: Cannot resolve reference to bean 'RSACBeanLocator' while setting bean property 'RSACBeanLocator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBeanLocator' defined in class path resource [conf/rsf-config.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentProcessorContributorParent$child' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFFixer' while setting bean property 'valueRef'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RSACBeanLocator' defined in class path resource [conf/rsf-config.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentProcessorContributorParent$child' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFFixer' while setting bean property 'valueRef'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentProcessorContributorParent$child' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFFixer' while setting bean property 'valueRef'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFFixer' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFRSFExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFRSFExecutor' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFExternalContext' while setting bean property 'externalContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFExternalContext' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'SWFParameterMap' while setting bean property 'parameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SWFParameterMapInterpreter' defined in class path resource [conf/rsf-swf-requestContext.xml]: Cannot resolve reference to bean 'requestMap' while setting bean property 'requestParameterMap'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'earlyRequestParser' defined in class path resource [conf/rsf-requestscope-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
Caused by: 
java.lang.NullPointerException
I	at uk.org.ponder.rsf.servlet.ServletEarlyRequestParser.init(ServletEarlyRequestParser.java:40)

In general the useful material is i) the message accumulated at the LEAST derived stack frame, and ii) the trace generated at the MOST derived stack frame.

The following SVN link to "UniversalRuntimeException" shows a possible implementation strategy and usage style for an Exception which produces more condensed messages, with only a single Exception object for a stack. Some of this code is devoted to conversion and unwrapping of checked exceptions and so is not directly relevant to this use case.

https://saffron.caret.cam.ac.uk/svn/projects/PonderUtilCore/trunk/src/uk/org/ponder/util/UniversalRuntimeException.java


Affects: 2.0.6

Issue Links:

  • #19175 OutOfMemoryError caused by nested UnsatisfiedDependencyExceptions
  • #12854 Overhaul core container error reporting

1 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 25, 2016

Marten Deinum commented

Also #19175 is related to this?

@NathanQingyangXu
Copy link

@NathanQingyangXu NathanQingyangXu commented Mar 17, 2020

Marten Deinum commented

Also #19175 is related to this?

It is indirectly related. This issue is about avoiding duplication in stack trace error reporting mechanism, the other ticket is more drastic to replace the stack trace with other mechanism.

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

No branches or pull requests

2 participants