users@glassfish.java.net

MySql connector problems, Class name is wrong or classpath

From: <glassfish_at_javadesktop.org>
Date: Wed, 04 Feb 2009 07:48:11 PST

Hi,

I keep receiving a "Class name is wrong or classpath is not set" error when pinging from the admin gui,
even though I've placed mysql-connector-java-5.1.6-bin.jar in
glassfish/lib, glassfish/domain/domains1/lib and
glassfish/domain/domains1/lib/ext

Any ideas?

I'm using these resources:
<resources>
<jdbc-connection-pool
name="mysql"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
res-type="javax.sql.DataSource">
<property name="user" value="root"/>
<property name="password" value="password"/>
<property name="url" value="jdbc:mysql://localhost:3306/db"/>
</jdbc-connection-pool>
<jdbc-resource
enabled="true"
jndi-name="jdbc/db"
object-type="user"
pool-name="mysql"/>
</resources>

The exception:

[#|2009-02-04T16:39:35.305+0100|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-1;Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource;_RequestID=d85d7551-9f1e-4b8d-9c0c-9c74ddda5d10;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource]|#]

[#|2009-02-04T16:39:35.321+0100|SEVERE|sun-appserver9.1|web.TimeReportServlet|_ThreadID=19;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=d85d7551-9f1e-4b8d-9c0c-9c74ddda5d10;|exception caught
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build SNAPSHOT (02/01/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Error Code: 0
        at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
        at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:150)
        at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
[Message sent by forum member 'ptony' (ptony)]

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