Roller 4 on Glassfish v3

2008 May 20
by Dick

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.

5 Responses leave one →
  1. 2008 November 17
    Alex Coles permalink

    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. 2008 November 23

    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.

  3. 2009 March 13

    Dave,

    Thanks for sharing your knowledge so freely. I noticed on the Roller lists that you deployed Roller on Glassfish v2 and used an Oracle backend. We are trying to do just that but are have some trouble. Do you have something list this post for a Glassfish v2 configuration?

    Thanks
    Darryl

  4. 2009 March 16

    Hi Darryl

    I didn’t set up the database, but yes we got it working OK with 10i.

    Drop me an email with any errors and I’ll see if I can help.

Trackbacks & Pingbacks

  1. glassfish v3 ships! | number 9

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS