Shuttle between Galaxies: 5/13/07 - 5/20/07

Thursday, May 17, 2007

problem in setting mysql XA Datasource

If you intend to use GlassFish/Sun App Server MySql and to use the XA data source .
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:

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

...
and the default class added by default wasn't listed:
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 :

Tuesday, May 15, 2007

Problem in switching locale of NetBeans multi-lanuge release

Update: This problem described here will only apply to MS Windows XP Chinese version.

In my opinions, on daily working platform, the i18n font problem of JDK/NetBeans has become history. But as I have filed a bug into IssueZilla, this problem is again appeared in this case:

1. download the multi-language release install bundle

2. (Because I'm not happy with some translating, so) switch to the language en by appending one startup parameter into $NetBeans/etc/netbeans.conf file:
netbeans_default_options="$THE DEFAUlT AFTER INSTALL --locale en"
the syntax is: --locale language[:country[:variant]]

3. you will see below result after started: the famous font problem is out again - displayed as
Small Box


Currently, if I want to a workarounds for this problem, you can do this:

1. Revert back to the default locale the JVM running on, and I have to pleasure with unclear translating.

2. download the English bundle