In the process of current configuration , the problems encountered are as follows :
recursive steps :
1. (If not done before so this step) Add Mysql Connector/J package (as mine : mysql-connector-java-3.1.12-bin.jar) into Gl assFish/Sun App Server installation directory , subdirectory \AppServer\l ib\
2. start GlassFish/Sun App Server. You can right-click Run time | Servers | Sun App Server and select start
3. Once started, Right click on Sun App Server Admin-> View console
4. Login Admin console
5. Navigation on the left side, clicking on Resources | JDBC | ConnectionPool, in the head part of the form in right side , Click New ... button
6. the right to fill out :
Name : MySql.
Resource Type : javax.sql.XADataSource
Database Vendor : mysql
Then click next
7. The value for 'Datasource class name' automatically insert : com.mysql.jdbc.jdbc2.optional.MysqlXaCon nectionPoolDataSource, this value is wrong.
If you want to try the case, fill value in the bottom Properties pane:
Click Finish
8. In the results window Click Mysql
9. In the opened pages can see one ping button, it is used to test configuration is successful or not, click and you will see the following error :
The solution :
If you unzip mysql-connector-java-3.1.12-bin.jar package, you could see this class in com.mysql.jdbc.jdbc2.optional package:
and the default class added by default wasn't listed:
com/mysql/jdbc/jdbc2/optional/
com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.class
com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.class
com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.class
com/mysql/jdbc/jdbc2/optional/MysqlDataSource.class
com/mysql/jdbc/jdbc2/optional/MysqlDataSourceFactory.class
com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.class
com/mysql/jdbc/jdbc2/optional/MysqlXAConnection.class
com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.class
com/mysql/jdbc/jdbc2/optional/MysqlXAException.class
com/mysql/jdbc/jdbc2/optional/MysqlXid.class
com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.class
com/mysql/jdbc/jdbc2/optional/StatementWrapper.class
com/mysql/jdbc/jdbc2/optional/SuspendableXAConnection.class
...
com.mysql.jdbc.jdbc2.optional.MysqlXaConnectionPoolDataSource.
But a similar class is here: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
In page: Application Server > Resources > JDBC > Connection Pools > MySql:
1. Change Datasource class name to the value to: com.mysql.jdbc.jdbc2.optional.MysqlConne ctionPoolDataSource
2. Click on the Save button
3. Click on the Ping button. Successful result show :
No comments:
Post a Comment