David R. Heffelfinger

  Ensode Technology, LLC

 
Bookmark and Share

Installing Apache Roller in GlassFish


For a while i've had a a blog in JRoller. I've been wanting to move my blog to my own domain, but due to lack of time and other commitments I hadn't been able to do it. Well today I finally did it.
I figured a good first entry would be to talk about how to get Apache Roller going under GlassFish, which happens to be my Java EE server of choice, and the one that powers my site. GlassFish comes with the JavaDB RDBMS "out of the box", which is what I'm using in this Roller installation.

After downloading Roller, the first thing we need to do is to create the database that Roller will use. In JavaDB, we can accomplish this with the ij utility.

In ij, we need to issue the following commands to create the database.


connect 'jdbc:derby://localhost:1527/roller;create=true';

Then we need to add a user to the database:

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.admin','noneofyourbusiness');

The above command creates a user with username of "admin" and password of "noneofyourbusiness". The username and password can be modified as appropriate.

We then need to grant full access to our admin user:

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.fullAccessUsers','admin');

We are done with the database creation.

Now we need to create a GlassFish connection pool and JDBC Resource for our new database, this can be accomplished easily with the asadmin tool:


asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property user=admin:password=noneofyourbusiness:databaseName=roller rollerConnectionPool

The value of the databaseName property must match the name we gave our database in the first step.

To create the datasource/JDBC resource, we need to issue the following asadmin command:

asadmin create-jdbc-resource --connectionpoolid rollerConnectionPool jdbc/rollerdb

It is important to use the JNDI name of jdbc/rollerdb, otherwise the roller code won't be able to find the datasource.

After we have created the connection pool and datasource, we need to create a file called roller-custom.properties with the following content:


installation.type=auto
database.configurationType=jndi
database.jndi.name=jdbc/rollerdb
mail.configurationType=jndi
mail.jndi.name=mail/Session

And copy it to the lib/classes folder of on the GlassFish domain we are using.

At this point we are ready to deploy Roller, just deploy it as usual and it should "just work".

Good Luck.

 
 
 
 
Comments:

Post a Comment:
Comments are closed for this entry.
 

« March 2024
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today

 
© David R. Heffelfinger