dev@glassfish.java.net

TopLink and MySQL in GFv2

From: Deepak Gothe <Deepak.Gothe_at_Sun.COM>
Date: Mon, 04 Jan 2010 19:16:29 +0530

Hi,
   My webapp uses JPA(Toplink) for database operations and i am using
MySQL. When i run the app, i am getting an exception "Caused by:
java.sql.SQLException: No suitable driver found for
jdbc:mysql://localhost:3306/sample"

I found that this was because of classpath issue..toplink jar is in
appserver classpath(glassfish/lib), while mysql jar is in domain
classpath(glassfish/domains/domain1/lib). After i copied mysql jar to
glassfish/lib. It started working fine. My question is..is this the only
way...Is there any other way..something like specifying to toplink to
look in domainRoot also. Even including toplink-essentials.jar in
WEB-INF/lib of the webapp didn't help.


Thanks,
Deepak