5

I'm dealing with a SEVERE exception in Java that looks like this:

SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birtReportRenderer': Injection of autowired dependencies failed; 

nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.convergys.raspberry.server.filemgmt.FileWorker.setFileAuditTbl(com.convergys.raspberry.server.database.FileAuditTbl); 

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileAuditTbl': Invocation of init method failed; 

nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; 

nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'

All this nested exceptions were in line like this:

exception; exception; exception; etc.

What is the sequence of events here? Should I look to the last nested exception and deal with the JDBC, should I start with the first exception or should I look someplace else?

Please, let me know if you need more information.

Thanks.

1
  • 2
    Bottom-up for stack trace Commented Feb 6, 2015 at 10:09

5 Answers 5

3

You should start from root cause (bottom up approach to the stacktrace) , so the first one to look at,

nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.postgresql.Driver'

And it caused ,

nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;

And it in-turn caused the other ones and the failure of bean creation .So you need to check your postgresql driver first.

Also see What is a stack trace, and how can I use it to debug my application errors?

Sign up to request clarification or add additional context in comments.

Comments

1

Last one in log is the root cause. You have a problem with postgres driver.

Comments

1

Starting with the last nested exception is a good idea. That is the exception that is throwing first. Than read the exceptions to the top.

so this causes the exception:

Cannot load JDBC driver class 'org.postgresql.Driver'

Comments

1

You should read a stack trace bottom-up, the problem is that your JDBC driver could not be loaded, most likely it is not on the classpath.

Comments

1

Java kept its exception in stack, the main cause of exception present in bottom of stack, so read exception from bottom to top.

enter image description here

1 Comment

Thanks for the graphical approach

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.