Error deploying Hibernate app on JBoss - No suitable driver found for jdbc?

First of all: your DB connection URL looks incorrect. It should probably be jdbc:mysql://localhost:3306/socialcv .

Up vote 0 down vote favorite share g+ share fb share tw.

I have a Spring/Hibernate web application (currently working fine on Tomcat) that I am attempting to deploy to JBoss 7.1 AS. The application all starts correctly, but if I set the Hibernate Persistence settings to create tables then I get an error on startup. My persistence XML that was working on tomcat is as follows: org.hibernate.ejb.

HibernatePersistence When I moved this PU to JBoss I started getting errors stating that it couldnt connect to the DB: 20:41:18,312 ERROR org.hibernate.tool. Hbm2ddl. SchemaExport (MSC service thread 1-5) HHH000231: Schema export unsuccessful: java.lang.

UnsupportedOperationException: The application must supply JDBC connections I googled and found a suggestion that I update my PU as follows by adding the hibernate connection details in the persistence config: org.hibernate.ejb. HibernatePersistence I have done this, and no longer get the user errors, but now just get the following error on app startup: 20:35:41,791 ERROR org.hibernate.tool. Hbm2ddl.

SchemaExport (MSC service thread 1-8) HHH000231: Schema export unsuccessful: java.sql. SQLException: No suitable driver found for jdbc\:mysql\://localhost\:3306/socialcv at java.sql.DriverManager. GetConnection(DriverManager.

Java:604) rt. Jar:1.7.0_03 at java.sql.DriverManager. GetConnection(DriverManager.

Java:190) rt. Jar:1.7.0_03 at org.hibernate.service.jdbc.connections.internal. DriverManagerConnectionProviderImpl.

GetConnection(DriverManagerConnectionProviderImpl. Java:173) hibernate-core-4.0.1.Final. Jar:4.0.1.

Final at org.hibernate.tool. Hbm2ddl. SuppliedConnectionProviderConnectionHelper.

Prepare(SuppliedConnectionProviderConnectionHelper. Java:51) hibernate-core-4.0.1.Final. Jar:4.0.1.

Final at org.hibernate.tool. Hbm2ddl. DatabaseExporter.(DatabaseExporter.

Java:52) hibernate-core-4.0.1.Final. Jar:4.0.1. Final at org.hibernate.tool.

Hbm2ddl.SchemaExport. Execute(SchemaExport. Java:368) hibernate-core-4.0.1.Final.

Jar:4.0.1. Final at org.hibernate.tool. Hbm2ddl.SchemaExport.

Create(SchemaExport. Java:305) hibernate-core-4.0.1.Final. Jar:4.0.1.

Final at org.hibernate.tool. Hbm2ddl.SchemaExport. Create(SchemaExport.

Java:294) hibernate-core-4.0.1.Final. Jar:4.0.1. Final at org.hibernate.internal.

SessionFactoryImpl.(SessionFactoryImpl. Java:452) hibernate-core-4.0.1.Final. Jar:4.0.1.

Final at org.hibernate.cfg.Configuration. BuildSessionFactory(Configuration. Java:1737) hibernate-core-4.0.1.Final.

Jar:4.0.1. Final at org.hibernate.ejb. EntityManagerFactoryImpl.(EntityManagerFactoryImpl.

Java:84) hibernate-entitymanager-4.0.1.Final. Jar:4.0.1. Final at org.hibernate.ejb.

Ejb3Configuration. BuildEntityManagerFactory(Ejb3Configuration. Java:904) hibernate-entitymanager-4.0.1.Final.

Jar:4.0.1. Final at org.hibernate.ejb. Ejb3Configuration.

BuildEntityManagerFactory(Ejb3Configuration. Java:889) hibernate-entitymanager-4.0.1.Final. Jar:4.0.1.

Final at org.hibernate.ejb. HibernatePersistence. CreateContainerEntityManagerFactory(HibernatePersistence.

Java:73) hibernate-entitymanager-4.0.1.Final. Jar:4.0.1. Final at org.jboss.as.jpa.service.

PersistenceUnitServiceImpl. CreateContainerEntityManagerFactory(PersistenceUnitServiceImpl. Java:162) jboss-as-jpa-7.1.1.Final.

Jar:7.1.1. Final at org.jboss.as.jpa.service. PersistenceUnitServiceImpl.

Start(PersistenceUnitServiceImpl. Java:85) jboss-as-jpa-7.1.1.Final. Jar:7.1.1.

Final at org.jboss.msc.service. ServiceControllerImpl$StartTask. StartService(ServiceControllerImpl.

Java:1811) at org.jboss.msc.service. ServiceControllerImpl$StartTask. Run(ServiceControllerImpl.

Java:1746) at java.util.concurrent. ThreadPoolExecutor. RunWorker(ThreadPoolExecutor.

Java:1110) rt. Jar:1.7.0_03 at java.util.concurrent. ThreadPoolExecutor$Worker.

Run(ThreadPoolExecutor. Java:603) rt. Jar:1.7.0_03 at java.lang.Thread.

Run(Thread. Java:722) rt. Jar:1.7.0_03 Has anyone come across this or know any solution?

Hibernate jdbc jboss link|improve this question asked 18 hours agorhinds1,104613 89% accept rate.

(like I mentioned, it is working as it is on tomcat) – rhinds 18 hours ago Maybe this value cause the problem jdbc\:mysql\://localhost\:3306/socialcv . Can you try instead this jdbc:mysql://localhost:3306/socialcv . – mbaydar 18 hours ago.

First of all: your DB connection URL looks incorrect. It should probably be jdbc:mysql://localhost:3306/socialcv. Then: Best install the MySQL driver as a module, see here: community.jboss.org/wiki/DataSourceConfi... Then use standalone.

Xml to define a data source using that driver: jdbc:mysql://localhost:3306/socialcv mysql TRANSACTION_READ_COMMITTED 10 100 true false FailingConnectionOnly hehe hehehe ... com.mysql.jdbc. Jdbc2.optional. MysqlXADataSource In your persistence.

Xml don't use the hibernate.connection. * properties, instead use: java:jboss/datasources/YourDatasourceName This is the de facto way to init the whole thing. Note, when using transaction-type="JTA" instead of transaction-type="RESOURCE_LOCAL" you have to change to java:jboss/datasources/YourDatasourceName which gives you CMT (container-managed transactions).

Https://community.jboss.org/wiki/DataSourceConfigurationinAS7#Installing_the_JDBC_Driver (notice the particular problems with the MySQL driver) Best, Anders.

I have just deployed the Mysql driver jar as instructed and am still getting the error. Any other ideas? – rhinds 18 hours ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions