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.
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.
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:
I was able to fix issue #2 by changing #showBigWeblogCalendar() to the following.
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.
Posted by Lance on March 05, 2011 at 06:21 PM MST #
Posted by Matt Raible on March 07, 2011 at 09:48 AM MST #
Posted by Raible Designs on May 05, 2011 at 03:10 PM MDT #
I realize this is eons after the fact but you mention you like to copy the new code base on top of the old one. How do you accomplish this given the huge change in structure in the 4 codebase to the 5 codebase? Any tips or pointers would be much appreciated.
Posted by Chris on October 23, 2013 at 06:12 PM MDT #
Posted by Matt Raible on October 24, 2013 at 09:49 AM MDT #
Makes sense. I have such a small amount of customization work on 4 I figured I'd just start with 5 and add my changes back in. Similar to what you're talking about. I'm also an Ant guy so I have some Maven learning to do. Probably will help me understand how the project is broke up much better when I better understand the POM etc...
Thanks for the reply!
Posted by Chris on October 24, 2013 at 02:10 PM MDT #
Posted by BUNTHA on October 31, 2013 at 09:37 AM MDT #