Monday, November 19, 2012

Failed to connect to the DataSource in Websphere Application Server

 
I was trying to create a data source in websphere application server using administrative console and my db (mysql) was running on same server. But I was running into following exception when I hit the test connection button.
Normally this exception occurs when JAAS alias under J2C Authentication Data Entries is not set properly, however in this case I have set the Component managed authentication alias properly. But was still having following problem:-
Could not invoke an operation on object: WebSphere:name=DataSourceCfgHelper,process=server1,platform=dynamicproxy,node=ip123Node01,version=7.0.0.11,type=DataSourceCfgHelper,mbeanIdentifier=DataSourceCfgHelper,cell=ip123Node01Cell,spec=1.0 because of an mbean exception: java.sql.SQLException: java.lang.IllegalAccessError: com/mysql/jdbc/ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection;
[10/5/12 5:00:37:241 UTC] 00000013 DSConfigurati W DSRA0174W: Warning: GenericDataStoreHelper is being used.
[10/5/12 5:00:37:305 UTC] 00000013 DataSourceCon E DSRA8040I: Failed to connect to the DataSource. Encountered “”: java.lang.IllegalAccessError: com/mysql/jdbc/ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection;
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141)
at com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.getPooledConnection(MysqlConnectionPoolDataSource.java:83)
This problem was vanished after I restarted the Websphere Application Server.
 
 

2 comments:

  1. Saved me some valuable time. Thanks! (When weird things happen to WAS a restart ia always a good idea)

    ReplyDelete