Roller 4 on Glassfish v3

Posted by Dick on May 20, 2008

I did Roller 3 on Glassfish 2 a while back
so thought that’d be the simplest thing to put on Glassfish3. The process has got quite a bit easier.

get roller

curl -O http://www.mirrorservice.org/sites/ftp.apache.org/roller/roller-4/v4.0.0/bin/apache-roller-4.0.zip
unzip apache-roller-4.0.zip

If you want to be able to send mail you’ll need Roller 4.0.1 (a bug in 4.0 breaks JavaMail on Glassfish).

setup an empty database

Roller4 isn’t perfect, but it kicks ass when it comes to auto-generating its
own database tables. It still needs the actual database to exist, though:

asadmin create-jdbc-connection-pool \
--datasourceclassname org.apache.derby.jdbc.EmbeddedDataSource \
--property databaseName=\$\{com.sun.aas.instanceRoot\}/databases/rollerdb:\
connectionAttributes=\;create\\=true rollerpool
asadmin ping-connection-pool rollerpool
asadmin create-jdbc-resource --connectionpoolid=rollerpool jdbc/rollerdb

(those of you playing along at home on an embedded database should look at upping your PermGen space at this point).

tweak roller

Roller 4 uses JNDI to find its DB by default, so there isn’t much to tweak:

cd ~/apache-roller-4.0/webapp/roller/WEB-INF/classes
curl -O http://files.hellooperator.net/glassfish/webapps/roller-custom.properties

You’ll want to change the mailserver to one you can use.

The full bewildering list of possible roller properties is in the Install Guide

You should make these changes to security.xml, too (unless you’re on Debian in which case, why bother?hee hee).

make and deploy a WAR

cd ~/apache-roller-4.0/webapp/roller
jar cvf ~/roller.war *
asadmin deploy ~/roller.war

Browse to http://localhost:8080/roller and try it out.

The database is created when you first connect, and the first user you make is the site admin.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Alex Coles Mon, 17 Nov 2008 04:48:49 GMT

    I wish I had come across your site many months ago, as its tutorials are great.

    For this tutorial though, I was wondering which version of GlassFish v3 you were using (or, indeed, if you’re using Roller 4.0, or the unofficial 4.0.1 release).

    I am unable to get the configuration above working without adding the following line to my roller-custom.properties:
    openjpa.QueryCompilationCache=false

    Without, that line I am encountering a CNFException (see http://gist.github.com/25652). I also posted to the Roller mailing list about this (see http://tinyurl.com/6alo59), but would love to know know which exact version of GlassFish v3 you were using, to see if that can’t help me reduce down the issue.

  2. Dick Sun, 23 Nov 2008 16:21:54 GMT

    Hi Alex, glad you found this stuff useful.

    I actually used roller 4.0 for this; it was very much a ‘kick the tyres’ thing and when I found
    out 4.0 couldn’t send mail on Glassfish I updated the post to recommend 4.0.1. I never saw the error you mentioned on 4.0.

    I used ‘glassfish v3 tech preview 2′, if that helps at all. But I’d guess your problem may be 4.0.1.

Comments