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 0.9.8.2 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)"'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Invalid authorization specification, message from server: "Access denied for user: 'tomcat-user@blogserver' (Using password: YES)" STACKTRACE: 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(MysqlIO.java:1977) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1900) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:950) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1887) at com.mysql.jdbc.Connection.
(Connection.java:440) at com.mysql.jdbc.NonRegisteringDriver .connect(NonRegisteringDriver.java:400) at org.apache.commons.dbcp.DriverConnectionFactory .createConnection(DriverConnectionFactory.java:83) at org.apache.commons.dbcp.PoolableConnectionFactory .makeObject(PoolableConnectionFactory.java:184) at org.apache.commons.pool.impl.GenericObjectPool .borrowObject(Unknown Source) [long stack trace continues...] ** END NESTED EXCEPTION ** Attempted reconnect 3 times. Giving up. ERROR 2004-06-13 15:34:40,841 | RollerFactory:setRoller | Error instantiating org.roller.business.hibernate.RollerImpl
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
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 0.9.8.2 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.