How to set up a MySQL driver jar file for data collection using WebLogic server using RSA Via Lifecycle and Governance
2 years ago
Originally Published: 2016-07-01
Article Number
000067343
Applies To
RSA Product Set: Identity Management and Governance
RSA Product/Service Type: Hosted
RSA Version/Condition: 6.9.1 P02
Platform: WebLogic 10.3.6.0
Database  Version: Oracle 11g (11.2.0.4.0)
MySQL Server: 6.5
 
Issue
The customer had used MySQL Server 5.0 and MySQL Driver jar file 5.1.17 before. It was working perfectly fine.

Since upgrading their MySQL Server from 5.0 to 5.6, they faces an error when testing an Account Data Collector with MySQL. The error states that it could not get data because the MySQL syntax they use is not correct and the MySQL Driver jar file 5.1.17 is not supported in MySQL Server 5.6.

Therefore, the customer downloaded the latest MySQL Driver jar file 5.1.39 to MySQL Server 5.6. Then test connection of the Account Data Collector. They currently have syntax 'SET OPTION SQL_SELECT_LIMIT=5'. 

The details of the error also found in AveksaServer.log as following:
 
05/11/2016 21:05:08.603 ERROR (ApplyChangesRegularThread-65) [SystemErr] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=5' at line 1 
05/11/2016 21:05:08.603 ERROR (ApplyChangesRegularThread-65) [SystemErr] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
05/11/2016 21:05:08.603 ERROR (ApplyChangesRegularThread-65) [SystemErr] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
05/11/2016 21:05:08.603 ERROR (ApplyChangesRegularThread-65) [SystemErr] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
05/11/2016 21:05:08.604 ERROR (ApplyChangesRegularThread-65) [SystemErr] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
05/11/2016 21:05:08.604 ERROR (ApplyChangesRegularThread-65) [SystemErr] at com.mysql.jdbc.Util.handleNewInstance(Util.java:353) 
05/11/2016 21:05:08.604 ERROR (ApplyChangesRegularThread-65) [SystemErr] at com.mysql.jdbc.Util.getInstance(Util.java:336) 
. 
. 
05/11/2016 21:05:08.608 ERROR (ApplyChangesRegularThread-65) [SystemErr] at java.lang.Thread.run(Thread.java:745) 
05/11/2016 21:05:08.609 WARN (ApplyChangesRegularThread-65) [com.aveksa.collector.accountdata.DBGenericAccountReader] Could not clean up database objects: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1 FAILED method=cleanup 
05/11/2016 21:05:08.609 ERROR (ApplyChangesRegularThread-65) [com.aveksa.collector.accountdata.DBGenericAccountReader] Error while extracting the account data: com.aveksa.common.DataReadException: ERROR: Could not get accounts data: FAILED method=collectAccounts 
05/11/2016 21:05:08.611 ERROR (ApplyChangesRegularThread-65) [com.aveksa.client.datacollector.framework.DataCollectorManager] DCM281: Collection Failed: CollectionFailedEvent[cmi = CollectionMetaInfo[{ID=3, run_id=1462980907904, collector_id=1101, test-run=true, collector_name=NovopayBusinessBankking_ADC2, data_size=287, data_file=/domain/aveksa_UAT/servers/aveksa/tmp/_WL_user/aveksa/2jhnnj/aveksa.war/WEB-INF/LocalAgent/collected_data/3.data}] message = null cause = com.aveksa.sdk.collector.CollectionException: com.aveksa.common.DataReadException: ERROR: Could not get accounts data: ] 
com.aveksa.sdk.collector.CollectionException: com.aveksa.common.DataReadException: ERROR: Could not get accounts data: 
at com.aveksa.collector.accountdata.DBGenericAccountReader.collectAccounts(DBGenericAccountReader.java:213) 
at com.aveksa.collector.accountdata.DBGenericAccountReader.collectTestData(DBGenericAccountReader.java:141) 
at com.aveksa.client.datacollector.collectors.accountdatacollectors.AccountDataCollector.collectData(AccountDataCollector.java:358) 
. 
. 
at com.aveksa.client.component.communication.ChangeListHandler.access$300(ChangeListHandler.java:58) 
at com.aveksa.client.component.communication.ChangeListHandler$ChangeApplyingRunnable.run(ChangeListHandler.java:275) 
at java.lang.Thread.run(Thread.java:745) 
Caused by: com.aveksa.common.DataReadException: ERROR: Could not get accounts data: 
at com.aveksa.collector.accountdata.DBGenericAccountReader.extractAccounts(DBGenericAccountReader.java:349) 
at com.aveksa.collector.accountdata.DBGenericAccountReader.collectAccounts(DBGenericAccountReader.java:201) 
... 14 more 
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=5' at line 1 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
at com.mysql.jdbc.Util.handleNewInstance(Util.java:353) 
at com.mysql.jdbc.Util.getInstance(Util.java:336) 
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031) 
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) 
. 
. 
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1205) 
at com.aveksa.collector.accountdata.DBGenericAccountReader.extractAccounts(DBGenericAccountReader.java:286) 
... 15 more 
05/11/2016 21:05:08.665 ERROR ([ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)') [com.aveksa.server.utils.NodeMessageBroker] Exception while getting test data from collector 
com.aveksa.server.runtime.ServerException: com.aveksa.sdk.collector.CollectionException: com.aveksa.common.DataReadException: ERROR: Could not get accounts data: . Caused by com.aveksa.common.DataReadException: ERROR: Could not get accounts data: . Caused by com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=5' at line 1 Caused By
.
.



This is caused by the MySQL Driver jar file not being setting up correctly on WebLogic server.
Resolution

Refer to release notes for 'MySQL Connector/J 5.1.20' in the following link that 'MySQLSyntaxErrorException' bug due to SET OPTION syntax change was fixed in this release.

https://dev.mysql.com/doc/relnotes/connector-j/5.1/en/news-5-1-20.html

This is the reason why MySQL Database ADC is working with MySQL connector jar 5.1.20 and above. Suggest to download the latest version of MySQL Driver jar file, e.g. 5.1.39, for MySQL Server 5.6. 

There are the steps to set up the MySQL Driver jar file on WebLogic server:

  1. Replace the mysql-connector jars that have been installed while installing WebLogic server.
    1. Download the latest MySQL Driver jar file, e.g. mysql-connector-java-5.1.39.tar.gz, from here - http://dev.mysql.com/downloads/connector/j/ , to WebLogic Server.
    2. Unzip the MySQL Driver jar file.
    3. Change directory to  $WL_HOME/server/lib    (e.g. /middleware/wlserver_10.3/server/lib ): cd  $WL_HOME/server/lib or cd /middleware/wlserver_10.3/server/lib
    4. Copy the mysql-connector-java-5.1.39-bin.jar  file to here.
    5. Remove the existing  'mysql-connector-java-commercial-5.x.x-bin' jar(s)
    6. Change directory to /middleware/wlserver_10.3/common/bincd /middleware/wlserver_10.3/common/bin
    7. The 'commEnv.sh' file would be found in here.
         User-added image
    8. make a backup of the 'commEnv.sh' file.
    9. edit the 'commEnv.sh' file by using vi editor: vi commEnv.sh
    10. Search for 'WEBLOGIC_CLASSPATH' and add the following to it
         ${WL_HOME} /server/lib/mysql-connector-java-5.1.39-bin.jar with ${CLASSPATHSEP} as separator: e.g
          /middleware/wlserver_10.3/server/lib/mysql-connector-java-5.1.39-bin.jar ${CLASSPATHSEP} 

         User-added image
    11. Save the changes.
    12. Restart the WebLogic Server.
  2. Add the latest mysql-connector jar file to aveksaDomain's lib directory. (e.g. /domain/aveksa_UAT/lib )
    1. Rename the mysql-connector-java_.jar file to mysql-connector-java_.jar.old
    2. Copy the mysql-connector-java-5.1.39-bin.jar file to here                               User-added image
    3. Restart App Server 

Now the MySQl Driver jar file 5.1.39 is available to use.  To configure the Account Data Collector and run the Test Connection. It should work fine.