Spring MVC app has Oracle and Hibernate properties in a file like this (persistence-oracle.properties):
# jdbc.X
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=[Database URL]
jdbc.user=[Username]
jdbc.pass=[Password]
# hibernate.X
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.show_sql=true
#hibernate.hbm2ddl.auto=create-drop
And while the tests show that the app can connect to and query the database and get data back, when I try to package it with maven, I get this error:
Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
The reason the properties are in this properties file and not hibernate.cfg.xml is because configuration is done via Spring Java Configuration similar to step 3 here
Why can't Maven find the driver while Spring can?
Edit1: Oracle dependency
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>