users@glassfish.java.net

Unable to find suitable MySQL driver class for Hibernate schema update

From: <glassfish_at_javadesktop.org>
Date: Thu, 06 Aug 2009 12:14:58 PDT

I have a Spring/Hibernate application which I am in the process of converting into a RESTful web services application using Jersey and which I am attempting to deploy on Glassfish. When I deploy the web application I am seeing an error in the server.log which tells me that the database metadata can't be fetched because no suitable driver class can be found for my MySQL data source's URL:

[#|2009-08-05T18:28:54.574-0600|SEVERE|sun-appserver2.1|org.hibernate.tool.hbm2ddl.SchemaUpdate|_ThreadID=14;_ThreadName=pool-1-thread-3;_RequestID=4f6b2231-3fb3-45d4-86c6-2e828495cd00;|could not get database metadata
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/lifecycle
        at java.sql.DriverManager.getConnection(DriverManager.java:602)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:281)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:269)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:253)
        at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:234)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
        at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
...

The data source URL and driver class is the same for both the stand-alone application and the web application and I never get this error when running the stand-alone application. Can anyone comment as to whether or not there is additional Glassfish configuration I need to perform to get around this issue, or any other suggestions as to what may be amiss?

Thanks in advance for your help.

--James
[Message sent by forum member 'monocongo' (monocongo)]

http://forums.java.net/jive/thread.jspa?messageID=359296