We have a project made in netbeans 7.3 and are about to deploying this to a remote glassfish server, everything is configured and set up properly and the connection pools for our project are also generated in glassfish.
Currently we are getting this error when deploying to the remote server:
deploy?DEFAULT=D:\\SVN\\PTS62\\Applicaties\\Rekeningrijderwebsite\\RekeningRijder\\dist\\RekeningRijder.war&name=RekeningRijder&contextroot=/RekeningRijder&force=true failed on GlassFish Server 3+
Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.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. Please see server.log for more details.
And the message the server generates:
Caused by: javax.resource.ResourceException: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:292) at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:114) at com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:1307) at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:163) at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:102) at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87) ... 62 more
Google wasn't very helpfull before, so hopefully you guys/girls can help me
Thanks in advance!
You may need a mysql / java connector.
You can find it there . Extract the mysql-connector-java .jar from the archive. Then place it into the glassfish external lib directory {INSTALL DIR}/glassfish/domains/domain1/lib/ext.
Restart your glassfish server.
There are more details on this answer . If that's not what you are looking for, or if it doesn't work, tell us. @+
是的,你只是缺少mysql lib,只需找到并下载mysql-connector-java-5.xx-bin.jar
副本到E:\\Projects\\glassfish3.1.1\\glassfish\\lib
然后重新启动服务器并享受!!!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.