mysql - Unable to Connect to JDBC Connection Pool from Glassfish -


i running glassfish server open source edition 3.1.2.2 (build 5) mysql

i have created jdbc connection pool using netbeans.

googled problem found adding classpath issue. connecting mysql database glassfish classpath not set or classname wrong , http://bhapca.blogspot.in/2009/06/class-name-is-wrong-or-classpath-is-not.html added jar in directory.

c:\program files\glassfish-3.1.2.2\glassfish\domains\domain1\lib 

and tried in

c:\program files\glassfish-3.1.2.2\glassfish\domains\domain1\lib\ext 

restarted server many times. re-created connection pool .still no success.

i when try pinging admin console

error error has occurred ping connection pool failed affablebeanpool. class name wrong or classpath not set : com.mysql.jdbc.jdbc2.optional.mysqldatasource please check server.log more details. 

related server log entry:

log entry detail  timestamp  jul 15, 2013 15:45:49.340 log level  warning logger  javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service name-value pairs  _threadid=22;_threadname=thread-2; record number  3172 message id  rar8054 complete message  exception while creating unpooled [test] connection pool [ affablebeanpool ], class name wrong or classpath not set : com.mysql.jdbc.jdbc2.optional.mysqldatasource 

and

log entry detail  timestamp  jul 15, 2013 15:39:33.777 log level  severe logger  javax.enterprise.resource.resourceadapter.com.sun.gjc.util name-value pairs  _threadid=27;_threadname=thread-2; record number  3153 message id  complete message  rar5099 : wrong class name or classpath datasource object java.lang.classnotfoundexception: com.mysql.jdbc.jdbc2.optional.mysqldatasource @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:307) @ java.lang.classloader.loadclass(classloader.java:248) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:247) @ com.sun.gjc.common.datasourceobjectbuilder.getdatasourceobject(datasourceobjectbuilder.java:285) @ com.sun.gjc.common.datasourceobjectbuilder.constructdatasourceobject(datasourceobjectbuilder.java:114) @ com.sun.gjc.spi.managedconnectionfactory.getdatasource(managedconnectionfactory.java:1307) @ com.sun.gjc.spi.dsmanagedconnectionfactory.getdatasource(dsmanagedconnectionfactory.java:163) @ com.sun.gjc.spi.dsmanagedconnectionfactory.createmanagedconnection(dsmanagedconnectionfactory.java:102) @ com.sun.enterprise.connectors.service.connectorconnectionpooladminserviceimpl.getunpooledconnection(connectorconnectionpooladminserviceimpl.java:697) @ com.sun.enterprise.connectors.service.connectorconnectionpooladminserviceimpl.testconnectionpool(connectorconnectionpooladminserviceimpl.java:426) @ com.sun.enterprise.connectors.connectorruntime.pingconnectionpool(connectorruntime.java:1086) @ org.glassfish.connectors.admin.cli.pingconnectionpool.execute(pingconnectionpool.java:130) @ com.sun.enterprise.v3.admin.commandrunnerimpl$1.execute(commandrunnerimpl.java:348) @ com.sun.enterprise.v3.admin.commandrunnerimpl.docommand(commandrunnerimpl.java:363) @ com.sun.enterprise.v3.admin.commandrunnerimpl.docommand(commandrunnerimpl.java:1085) @ com.sun.enterprise.v3.admin.commandrunnerimpl.access$1200(commandrunnerimpl.java:95) @ com.sun.enterprise.v3.admin.commandrunnerimpl$executioncontext.execute(commandrunnerimpl.java:1291) @ com.sun.enterprise.v3.admin.commandrunnerimpl$executioncontext.execute(commandrunnerimpl.java:1259) @ org.glassfish.admin.rest.resourceutil.runcommand(resourceutil.java:214) @ org.glassfish.admin.rest.resources.templateexeccommand.executecommand(templateexeccommand.java:127) @ org.glassfish.admin.rest.resources.templatecommandgetresource.processget(templatecommandgetresource.java:78) @ sun.reflect.generatedmethodaccessor188.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ com.sun.jersey.spi.container.javamethodinvokerfactory$1.invoke(javamethodinvokerfactory.java:60) @ com.sun.jersey.server.impl.model.method.dispatch.abstractresourcemethoddispatchprovider$responseoutinvoker._dispatch(abstractresourcemethoddispatchprovider.java:205) @ com.sun.jersey.server.impl.model.method.dispatch.resourcejavamethoddispatcher.dispatch(resourcejavamethoddispatcher.java:75) @ com.sun.jersey.server.impl.uri.rules.httpmethodrule.accept(httpmethodrule.java:288) @ com.sun.jersey.server.impl.uri.rules.sublocatorrule.accept(sublocatorrule.java:134) @ com.sun.jersey.server.impl.uri.rules.righthandpathrule.accept(righthandpathrule.java:147) @ com.sun.jersey.server.impl.uri.rules.sublocatorrule.accept(sublocatorrule.java:134) @ com.sun.jersey.server.impl.uri.rules.righthandpathrule.accept(righthandpathrule.java:147) @ com.sun.jersey.server.impl.uri.rules.resourceclassrule.accept(resourceclassrule.java:108) @ com.sun.jersey.server.impl.uri.rules.righthandpathrule.accept(righthandpathrule.java:147) @ com.sun.jersey.server.impl.uri.rules.rootresourceclassesrule.accept(rootresourceclassesrule.java:84) @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1469) @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1400) @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1349) @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1339) @ com.sun.jersey.server.impl.container.grizzly.grizzlycontainer._service(grizzlycontainer.java:182) @ com.sun.jersey.server.impl.container.grizzly.grizzlycontainer.service(grizzlycontainer.java:147) @ org.glassfish.admin.rest.adapter.restadapter.service(restadapter.java:148) @ com.sun.grizzly.tcp.http11.grizzlyadapter.service(grizzlyadapter.java:179) @ com.sun.enterprise.v3.server.hk2dispatcher.dispath(hk2dispatcher.java:117) @ com.sun.enterprise.v3.services.impl.containermapper$hk2dispatchercallable.call(containermapper.java:354) @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:195) @ com.sun.grizzly.http.processortask.invokeadapter(processortask.java:860) @ com.sun.grizzly.http.processortask.doprocess(processortask.java:757) @ com.sun.grizzly.http.processortask.process(processortask.java:1056) @ com.sun.grizzly.http.defaultprotocolfilter.execute(defaultprotocolfilter.java:229) @ com.sun.grizzly.defaultprotocolchain.executeprotocolfilter(defaultprotocolchain.java:137) @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:104) @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:90) @ com.sun.grizzly.http.httpprotocolchain.execute(httpprotocolchain.java:79) @ com.sun.grizzly.protocolchaincontexttask.docall(protocolchaincontexttask.java:54) @ com.sun.grizzly.selectionkeycontexttask.call(selectionkeycontexttask.java:59) @ com.sun.grizzly.contexttask.run(contexttask.java:71) @ com.sun.grizzly.util.abstractthreadpool$worker.dowork(abstractthreadpool.java:532) @ com.sun.grizzly.util.abstractthreadpool$worker.run(abstractthreadpool.java:513) @ java.lang.thread.run(thread.java:662) 

you've placed jdbc jar in domain folder, try putting in glassfish server folder.
c:\program files\glassfish-3.1.2.2\glassfish\lib


Comments