It's not a secret anymore!
The moose likes JBoss/WildFly and the fly likes org.hibernate.HibernateException: Specified JDBC Driver not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "org.hibernate.HibernateException: Specified JDBC Driver not found" Watch "org.hibernate.HibernateException: Specified JDBC Driver not found" New topic

org.hibernate.HibernateException: Specified JDBC Driver not found

Juan Carmona

Joined: Apr 08, 2012
Posts: 3
hi anyone, I have this problem using Hibernate 4 within a small EJB proyect
I have a META-INF/persistence.xml like this:

<persistence xmlns=""
<persistence-unit name="manager1" transaction-type="JTA">
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.password" value="xxxx"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/xxxx"/>
<property name="hibernate.connection.username" value="xxxx"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>

(I use the persistence.xml instead of the hibernate.cfg.xml when JBoss told it doesn't found the persistence.xml... so I put my config there)

I'm deploying the ejb jar within a JBoss 7.1.0 AS in Eclipse Indigo... my Library Classpath of the proyect has the JBoss7 and JRE System (1.6) libraries and a some jars I added in a folder /ejbModule/lib within the proyect. One of those jars is the mysql-connector-java-5.1.18-bin.jar and this is marked to be exported... but when I looked at the folder in JBoss (../standalone/deployments/Test.jar folder), I don't see the libs folder and I'm getting the error:

17:55:16,375 ERROR [] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."Test.jar#manager1": org.jboss.msc.service.StartException in service jboss.persistenceunit."AdminPape.jar#manager1": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.6.0_26]
at [rt.jar:1.6.0_26]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: manager1] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: org.hibernate.HibernateException: Specified JDBC Driver com.mysql.jdbc.Driver class not found
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(

please help me, regards
James Boswell

Joined: Nov 09, 2011
Posts: 1051

I believe class loading has radically changed in JBoss 7.

You may wish to refer to this:
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

I think your file is overriding the configuration here. try renaming the and try.

Avinash G.A
OCP Java SE 6 Programmer, OCP Java EE 5 Web Component Developer, OCE Java EE 6 Web Services Developer, VMware Certified Core Spring 3.x Developer, EMC Proven Professional (ISM-V2)
Avinash Ga
Ranch Hand

Joined: Aug 13, 2011
Posts: 78

I think your file is overriding the configuration here. try renaming the and try.
subject: org.hibernate.HibernateException: Specified JDBC Driver not found
jQuery in Action, 3rd edition