users@glassfish.java.net

Re: Persistence.xml

From: Bobby Bissett <Robert.Bissett_at_Sun.COM>
Date: Fri, 05 Feb 2010 10:43:10 -0500

On Feb 4, 2010, at 5:01 PM, glassfish_at_javadesktop.org wrote:

> Caused by: 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
> at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
> at
> oracle
> .toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:145)
> ... 16 more

Well, there you go. Your problem isn't in persistence.xml -- you have
a class not found issue. Make sure you've got the right jars, they're
in the right place, etc. Check the release notes or google for the
class name; you may have to download a separate jar for this. Side
note: I have a simple tool you can use to diagnose class not found
problems. It will search a whole file tree to tell you what jar a
certain class is in: https://jarsearch.dev.java.net/servlets/ProjectDocumentList

Important: when you first create the jdbc connection pool in the admin
console, click the Ping button to make sure everything is working. If
the connection can't talk to the database, nothing else is going to
work.

Cheers,
Bobby