Upgraded to Apache Roller 5.0, RC4
Last Sunday, Dave Johnson released Apache Roller 5.0, RC4. Since I'm an Apache Roller committer, and I've been seeing issues with comments throwing exceptions on this site, I decided to upgrade. In doing so, I discovered a number of issues. Hopefully by documenting them here, you'll be able to upgrade from Roller 4 to Roller 5 without any issues.
To upgrade, I took a snapshot of my existing site and database and copied them locally. After getting everything setup locally (importing existing database and upgrading it), I started Tomcat and began solving problems.
Database settings - JNDI vs. Properties
With Roller 4, I configured by database settings in a ROOT.xml so they'd be read using JNDI. With Roller 5, I got the following error when I tried to do this.
<openjpa-2.0.1-r422266:989424 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property. at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
I was able to get around this issue by adding the following to my roller-custom.properties:
database.configurationType=jdbc database.jdbc.driverClass=com.mysql.jdbc.Driver database.jdbc.connectionURL=jdbc:mysql://localhost/rollerdb database.jdbc.username=root database.jdbc.password= mail.configurationType=properties mail.hostname=localhost
After making this change, I received an error when Planet tried to startup:
ERROR 2011-03-02 09:56:08,502 DatabaseProvider:errorMessage - ERROR: unable to obtain database connection. Likely problem: bad connection parameters or database unavailable. FATAL 2011-03-02 09:56:08,502 RollerContext:contextInitialized - Roller Planet startup failed during app preparation org.apache.roller.planet.business.startup.StartupException: ERROR: unable to obtain database connection. Likely problem: bad connection parameters or database unavailable.
I don't remember why I enabled planet, but turning it off in roller-custom.properties seemed to solve the problem.
planet.aggregator.enabled=false
Password Encyrption
The next thing I tried to do was login. When this didn't work, I figured it must be related to password encryption. With Roller 4, I had to have "passwds.encryption.enabled=true" in roller-custom.properties. In Roller 5, I also had to add the encryption algorithm.
passwds.encryption.algorithm=SHA
GZip Compression
In November 2009, I optimized this site and used Roller's CompressionFilter and wro4j to gzip and concatenate JavaScript and CSS. With Roller 4, I used the CompressionFilter to compress *.css and *.js instead of using Wro4J's built-in gzip compression. The Roller 5 CompressionFilter seems to have issues with wro4j, so I had to disable it for *.css and *.js and use wro4j instead.
At this point, I figured I was good to go, so I zipped up my local WAR and scp'ed it to raibledesigns.com. I stopped Tomcat and attempted to upgrade my production MySQL database (version 3.23.56). Below is the error I received.
$ mysql -u raible -p raible < 400-to-500-migration.sql Enter password: ERROR 1064 (00000) at line 42: You have an error in your SQL syntax near 'as w set lastmodified = lastmodified, datecreated = datecreated, cr' at line 1
At this point, I figured my database might be slightly hosed, but since it was simply creating tables, I was probably OK. I restarted Tomcat and left the old version in place while I waited for a MySQL 5 database instance from my hosting provider, KGB Internet. Once I got the new instance, I imported my backed-up database, ran the upgrade script and everything worked just peachy.
I generally upgrade Roller by coping the new codebase over my old one. This is because I have a lot of symlinks and other files in my "ROOT" directory and like to keep those. In doing this, I found I had to do a couple things after copying everything over:
- Delete WEB-INF/lib and recopy from RC4's WEB-INF/lib.
- Delete WEB-INF/classes and recopy from RC4's WEB-INF/classes.
I then experienced some issues with JARs not being present for Roller's JSPWikiPlugin. I enabled this long ago, but don't use it anymore. However, to keep old posts still working, I wanted to enable it. The downloads for the plugin seem to be gone, but luckily I found a copy and put all the JARs into my WEB-INF/lib directory.
After starting Tomcat and browsing around a bit, I discovered two more issues:
- Search doesn't seem to work. For example, there are no results for jQuery.
- My Archives page's calendar didn't work. It showed the following:
$calendarModel.showWeblogEntryCalendarBig($weblog, $cat)
I was able to fix issue #2 by changing #showBigWeblogCalendar() to the following.
#showWeblogEntryCalendarBig($model.weblog "nil")
The first issue with search seems to remain.
If you notice any other issues on this site, please let me know. I'll try to get them fixed asap.
Update: I entered an issue for my search problem in Roller's JIRA. I also managed to figure out that the problem is due to the old version of oscache that's needed by the JSPWiki plugin. Hopefully we can get the plugin upgraded to avoid this issue for other users.