Not surprisingly, my first post to this blog is on the issues I encountered installing and getting the Roller webapp working with Tomcat and MySQL. I want to track these issues for my next installation.

The first minor issue involved deploying Roller to Tomcat and starting the server. I got this in my catalina.out Tomcat log:


DBCP borrowObject failed: java.sql.SQLException:
Server connection failure during transaction.
Due to underlying exception: 'java.sql.SQLException:
Invalid authorization specification,
message from server: "Access denied for user: 'tomcat-user@blogserver'
(Using password: YES)"'.
MESSAGE: Invalid authorization specification,  message from server:
"Access denied for user:
'tomcat-user@blogserver' (Using password: YES)"
java.sql.SQLException: Invalid authorization specification,
message from server: "Access denied for user:
'tomcat-user@blogserver' (Using password: YES)"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.NonRegisteringDriver
at org.apache.commons.dbcp.DriverConnectionFactory
at org.apache.commons.dbcp.PoolableConnectionFactory
at org.apache.commons.pool.impl.GenericObjectPool
.borrowObject(Unknown Source)
[long stack trace continues...]
Attempted reconnect 3 times. Giving up.
ERROR 2004-06-13 15:34:40,841
| RollerFactory:setRoller | Error instantiating

You can probably guess the source of this problem. The Roller installation guide mentions that you should grant access to the MySQL database to the user Tomcat uses for the data source:

mysql> create database roller;
mysql> grant all on roller.* to scott identified by 'tiger';
mysql> grant all on roller.* to scott@localhost identified by 'tiger';

But since my hostname name is blogserver, apparently that is used when logging into MySQL, not localhost.

I fixed the problem by going back to MySQL and adding:

mysql> grant all on roller.* to tomcat-user@blogserver
identified by '[password]';

That allowed Tomcat to start the Roller webapp.

The second problem is mentioned as a bug in the installation guide. I configured the login servlet to use MD5 encryption, as the documentatin suggested. And as the documentation says, the implementation of encryption is incomplete.

When you create a new user in the Roller main screen, it creates the user with a cleartext password. When you try to log in with that password, that’s when your entered password gets encrypted and tries to compare it against the plain text version in the rolleruser database table. Whoops.

The fix is mentioned in the installation guide: Go in and change the cleartext password in the rolleruser table to the MD5 version, using the MySQL md5() function. Pretty clear. Pretty easy. Nice documentation.