users@glassfish.java.net

Glassfish SQLException: Error in allocating a connection in MySQL

From: <glassfish_at_javadesktop.org>
Date: Thu, 05 Mar 2009 04:59:51 PST

Hi All,

I have just installed the Bundled Netbeans 6.5, Glassfish v2 and v3 Prelude (not including MySQL) that runs on top of MySQL 5.1 (separate installation) on server A, in order to mirror another similar working installation (Bundled Netbeans 6.1, Glassfish v2 including MySQL 5.0) on server B. Both Windows XP servers have got identical setups in their respective C:\Program Files\glassfish-v2ur2\domains\domain1\config\domain.xml files. However, the following error was encountered when trying to deploy the same EnterpriseApplication on server A which had no such problem on server B:

[u]Glassfish Server Log[/u]
[b]Server: unknown
RAR5099 : Wrong class name or classpath for Datasource Object
java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
        at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:251)
        at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:106)
RAR5038:Unexpected exception while creating resource for pool mysqlPool. Exception : Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
RAR5117 : Failed to obtain/create connection from connection pool [ mysqlPool ]. Reason : Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
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.MysqlConnectionPoolDataSource]
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException:
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.MysqlConnectionPoolDataSource
Error Code: 0
        at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305).[/b]
 
[u]EnterpriseApplication (EJB 3.0) Deployment output[/u]
[b]Deploying application in domain failed; Deployment Errorjava.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --
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.MysqlConnectionPoolDataSource
Error Code: 0
C:\Documents and Settings\Jack\EnterpriseApplication\EnterpriseApplicationBean-ejb\nbproject\build-impl.xml:400: The module has not been deployed.[/b]
Even manually re-creating the same project (as opposed to getting a copy of the Netbeans project folder from server B) did not make any difference. Likewise, the following jdbc connection pool definition was added possibly by Netbeans from Server Database JDBC Connection Resource setting:

<property name="URL" value="jdbc:mysql://localhost:3306/employeeDB"/>
      <property name="driverClass" value="com.mysql.jdbc.Driver"/>
      <property name="Password" value="abcdef"/>
      <property name="portNumber" value="3306"/>
      <property name="databaseName" value="employeeDB"/>
      <property name="serverName" value="localhost"/>
      <property name="User" value="applicationuser"/>

Can anyone see where the problem lies?

Any assistance would be much appreciated.

Thanks in advance,

Jack
[Message sent by forum member 'htran_888' (htran_888)]

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