4

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.

Alan
  • 1,479
  • 3
  • 20
  • 36

5 Answers5

2

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?

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56
1

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

Marcin Szymczak
  • 11,199
  • 5
  • 55
  • 63
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'
Jens
  • 67,715
  • 15
  • 98
  • 113
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.

meskobalazs
  • 15,741
  • 2
  • 40
  • 63
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

atish shimpi
  • 4,873
  • 2
  • 32
  • 50