Link to home
Start Free TrialLog in
Avatar of ashok Priyadarshan
ashok Priyadarshan

asked on

APACHE DERBY with spring framework is displaying: Could not load JDBC driver class [org.apache.derby.jdbc.ClientDriver]

nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [org.apache.derby.jdbc.ClientDriver]

I am trying to create a spring application to access a apache derby db.

Here is the full message

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'homeController': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field:
private net.codejava.spring.dao.ContactDAO net.codejava.spring.controller.HomeController.contactDAO;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getContactDAO' defined in class path resource [net/codejava/spring/config/MvcConfiguration.class]:
Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public net.codejava.spring.dao.ContactDAO net.codejava.spring.config.MvcConfiguration.getContactDAO()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getDataSource' defined in class path resource [net/codejava/spring/config/MvcConfiguration.class]:
Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.sql.DataSource net.codejava.spring.config.MvcConfiguration.getDataSource()] threw exception;
nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [org.apache.derby.jdbc.ClientDriver]

SAME WORKS ON WINDOWS without a flaw.

am I missing some entry in the pom or windows pulling some jdbc that I cannot see....
Avatar of dfke
dfke

Hi,

It looks like the Derby driver isn't in the project's classpath.

Right click on the project --> properties --> Libraries --> Add library --> JavaDB driver

Cheers
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.