NonRegisteringDriver illegally accessing "protected" member of class com/mysql/jdbc/ConnectionImpl
Hello,
I use MySQL Connector/J 5.1.33 and my setup is Websphere 8.5.5.0 and mysql on Windows 7 test machine (localhost).
Inside websphere, I set the property url to "jdbc:mysql://localhost:3306/test" and I use JAAS/J2C for authentication.
While trying to setup a mysql jdbc provider/data source in websphere, I am getting the following strange error:
[11/11/2014 15:25:36:179 EET] 00000136 DataSourceCon E DSRA8040I: Failed to connect to the DataSource. Encountered "": java.lang.IllegalAccessError: Class com/mysql/jdbc/NonRegisteringDriver illegally accessing "protected" member of class com/mysql/jdbc/ConnectionImpl
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:422)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:134)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:105)
at com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.getPooledConnection(MysqlConnectionPoolDataSource.java:48)
at com.ibm.ws.rsadapter.DSConfigHelper$1.run(DSConfigHelper.java:1266)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5474)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.rsadapter.spi.ServerFunction$6.run(ServerFunction.java:567)
....
[11/11/2014 15:25:36:185 EET] 00000136 MBeanHelper E Could not invoke an operation on object: WebSphere:name=DataSourceCfgHelper,process=server1,platform=dynamicproxy,node=2787w51Node01,version=8.5.5.3,type=DataSourceCfgHelper,mbeanIdentifier=DataSourceCfgHelper,cell=2787w51Node01Cell,spec=1.0 because of an mbean exception: java.sql.SQLException: java.lang.IllegalAccessError: Class com/mysql/jdbc/NonRegisteringDriver illegally accessing "protected" member of class com/mysql/jdbc/ConnectionImpl
Diging to some mysql source code that I found in the internet I saw inside NonRegisteringDriver.java a call:
Connection newConn = com.mysql.jdbc.ConnectionImpl.getInstance(
285 host(props), port(props), props, database(props), url);
This getInctance is a actually "protected" method...
Is this realy a bug or there is something else that I cannot figure out of? Could you please help?
Please note that I created a java jdbc source program and it connects successfully to the specific mysql server using the same connector/J.
Best regards,
Konstantinos