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


Samebug tips

This might be an issue with the file location in the Spark submit command. Try it with

spark-submit --master spark://master:7077 \
     hello_world_from_pyspark.py {file location}


6 months ago
Expert tip

Check if you've set a name in Application -> Run. If you didn't, the generated XML is gonna have missing information and then this exception will be thrown.


6 months ago
Expert tip

Solutions on the web

Solution icon of coderanch
com.mysql.jdbc.jdbc2.optional.MysqlRealmTestTwoConnectionPoolDataSource

Solution icon of java
via Java.net JIRA by easarina, 1 year ago
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of java
via Java.net JIRA by ljnelson, 1 year ago
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of stackoverflow
via Stack Overflow by MDaniyal
, 1 year ago
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

Solution icon of web
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of stackoverflow
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of stackoverflow
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of web
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of web
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Solution icon of stackoverflow
com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Stack trace

java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlRealmTestTwoConnectionPoolDataSource
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:285)
	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.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:697)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
384 times, 8 hours ago
3 times, 1 day ago
2 times, 5 days ago
1403 more bugmates