JBoss and mySQL

While JBoss is an enterprise strength application server, it probably has the worst documentation I have ever seen for an open source project. I have spent more hours debugging and troubleshooting simple issues than actually getting my idea to work before the launch. The online forums haven’t been worth talking about, either.

For instance, I just discovered that the truncation errors I was getting on the server launchtime were actually due to JBoss not fully supporting mySQL5. The workaround is actually as follows:

MySQL 5 can run in strict mode, which causes errors to be thrown instead of warnings when data truncation occurs (see mysql bug 14048).

Errors may look similar to this:

11:16:36,520 ERROR JDBCExceptionReporter? Data truncation: Data too long for column 'jbp_viewrealemail' at row 1

While MySQL 5 is not yet supported, there is a way to prevent the error from being thrown during the installation of the portal:

  1. If you have MySQL 5 installed already and running in strict mode, edit the my.ini (or my.cfg) file of MySQL and remove the “STRICT_TRANS_TABLES” part from the line: sql-mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,
    NO_ENGINE_SUBSTITUTION
  2. Add “jdbcCompliantTruncation=false” in your datasource descriptor file (*-ds.xml) under the deploy directory. Your connection URL should look like: <connection-url>jdbc:mysql://your-host-name:3306/jbossportal?
    useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>

This should prevent any further data truncation related errors during the portal installation.

Now that that is resolved, I need to figure out why the source tree of the JBoss Portal server doesn’t include the directory structure exactly as described in the “documentation”.

I love Enterprise Java too much to switch to .NET right now, but I hope I am able to get things running!

Leave a Reply

Your email address will not be published. Required fields are marked *