java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Stack Overflow | karx | 3 years ago
  1. 0

    Unable to Connect to JDBC Connection Pool from Glassfish

    Stack Overflow | 3 years ago | karx
    java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
  2. 0

    Glassfish + Postgres can't ping connection pool

    Stack Overflow | 4 years ago | Iwo Kucharski
    java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource
  3. 0

    Why can't I ping my database from JDBC Connection Pool?

    Stack Overflow | 12 months ago | Vrankela
    java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    1. Downloaded build 35 from http://dlc.sun.com.edgesuite.net/glassfish/3.1/promoted/glassfish-3.1-b35.zip 2. Unzipped and installed it. 3. Ran the following shell script: # Start the server $GLASSFISH_HOME/bin/asadmin start-domain # Copy MySQL drivers to extension directory for domain1 cp -f $CONNECTOR_J_HOME/*.jar $GLASSFISH_HOME/glassfish/domains/domain1/lib/ext # Create JDBC connection pool $GLASSFISH_HOME/bin/asadmin create-jdbc-connection-pool --datasourceclassname=com.mysql.jdbc.jdbc2.optional.MysqlDataSource --restype=javax.sql.DataSource --description "A JDBC connection pool providing access to the LEAD database." --property User=lead:Password=lead:DatabaseName=LEAD:Port=3306:ServerName=localhost "LEADConnectionPool" # Create the corresponding JDBC resource $GLASSFISH_HOME/bin/asadmin create-jdbc-resource --connectionpoolid "LEADConnectionPool" --description "A JDBC resource providing access to the LEAD connection pool" jdbc/LEAD 4. Ping the connection pool: asadmin ping-connection-pool LEADConnectionPool 5. Observe the following error: remote failure: Ping Connection Pool for LEADConnectionPool is Failed. Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details. Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details. Command ping-connection-pool failed. 6. Perform the same steps on b33 and observe no error.

    Java.net JIRA | 6 years ago | ljnelson
    java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
  6. 0

    exception creating a JDBC Connection Pool Glassfish v3

    Stack Overflow | 7 years ago | jon
    java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    com.mysql.jdbc.jdbc2.optional.MysqlDataSource

    at java.net.URLClassLoader$1.run()
  2. Java RT
    Class.forName
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    6. java.lang.Class.forName0(Native Method)
    7. java.lang.Class.forName(Class.java:247)
    7 frames
  3. Embedded GlassFish Web
    DSManagedConnectionFactory.createManagedConnection
    1. com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:285)
    2. com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:114)
    3. com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:1307)
    4. com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:163)
    5. com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:102)
    5 frames
  4. Connectors Runtime
    ConnectorRuntime.pingConnectionPool
    1. com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:697)
    2. com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:426)
    3. com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:1086)
    3 frames
  5. Embedded GlassFish Web
    PingConnectionPool.execute
    1. org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:130)
    1 frame
  6. Kernel Classes
    CommandRunnerImpl$ExecutionContext.execute
    1. com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    2. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    3. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    4. com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    5. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    6. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    6 frames
  7. GlassFish Admin
    TemplateCommandGetResource.processGet
    1. org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
    2. org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommand(TemplateExecCommand.java:127)
    3. org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGet(TemplateCommandGetResource.java:78)
    3 frames
  8. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3. java.lang.reflect.Method.invoke(Method.java:597)
    3 frames
  9. Jersey
    WebApplicationImpl.handleRequest
    1. com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    2. com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    3. com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    4. com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    5. com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    6. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    7. com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
    8. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    9. com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    10. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    11. com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    12. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    13. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    14. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    15. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    15 frames
  10. jersey-bundle
    GrizzlyContainer.service
    1. com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
    2. com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
    2 frames
  11. GlassFish Admin
    RestAdapter.service
    1. org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
    1 frame
  12. Grizzly WS
    GrizzlyAdapter.service
    1. com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    1 frame
  13. Kernel Classes
    ContainerMapper.service
    1. com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    2. com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    3. com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    3 frames
  14. Grizzly WS
    AbstractThreadPool$Worker.run
    1. com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    2. com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
    3. com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
    4. com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
    5. com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    6. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    7. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    8. com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    9. com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    10. com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    11. com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    12. com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    13. com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    13 frames
  15. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:662)
    1 frame