Home > Development, Open-Source > How-To Deploy Roller 4 on GlassFish V3

How-To Deploy Roller 4 on GlassFish V3


I’ve just started blogging seriously. Many free blogging tool providers are available. Widely known are the WordPress and Blogger. For some reasons, I decided to use WordPress as my main blogging tool.

I’ve given some thoughts to start developing a Web-based Blogging Tool just to have some hands-on experience on the Web Development and Design process. Besides, as I advocate the Open Source Community I would like to make a humble contribution to this great community.

I was wondering which platform on which I should rely to start developing this project. From my notice, most web applications nowadays are developed in PHP. PHP has been used very widely by the public. Well, PHP is a very cool scripting language and I’ve always looked forward to learning it. But, as it is a top priority to my career path is to have a solid development background using Java/J2EE technology, I’ve decided to start a project for developing a Java Web-based Blogging Application. Fortunately, somebody already started developing such a project long time ago, since 2002. This application is sponsored by Apache Software Foundation and is called Roller Weblogger.

So, trying to make Roller up and running, we need to download a Java Web Server to be the deploying environment for Roller. You can download Tomcat and use it as a Web Server to deploy Roller. Refer to this Installation Guide to deploy Roller on Tomcat.

In my case, I decided to use GlassfishV3 due to the features and frameworks bundled with. Here, I’ll explain step by step how to install GlassfishV3, deploy Roller on it, and avoid a possible problem that might hinder the deployment process!

So, let’s start!

STEP 1: GlassfishV3

STEP 1.1: Download GlassfishV3

Download GlassFishV3 Prelude or Preview. Compare between them here.

Refer to Comment#:1

STEP 1.2: Install/Configure GlassfishV3

Install GlassfishV3 by simply running the script. It is not a big deal just follow the instructions!

STEP 1.3: Start GlassfishV3

Go to where Glassfish binary files are:

cd $GF_HOME/glassfish/bin
  • To start the domain:
    ./asadmin start-domain
  • To stop the domain:
    ./asadmin stop-domain

Or alternatively, I prefer to start/stop the server by running these: “log will be output to the screen, so you can monitor it

  • To start the server:
    ./startserv
  • To stop server:
    ./stopserv

Now, you can reach the Admin Console at:

For further details, have a look at the GlassfishV3 Quick Start Guide!

STEP 2: MySQL JDBC Connection

STEP 2.1: Download Connector/J

You will need to download the MySQL JDBC Connector to allow Roller interact with the MySQL Database Server. Here, I used the MySQL Connector/J 5.1.10.

Place the Connector/J in:

cp mysql-connector-java-5.1.10-bin.jar $GF_HOME/glassfish/lib/

STEP 2.2: Provide JNDI

In GlassfishV3:

  • Create JDBC Connection Pool: (Admin GUI -> Application Server -> Resources -> JDBC -> Connection Pools)

  • Create JDBC Resources (Admin GUI -> Application Server -> Resources -> JDBC -> JDBC Resources)

Restart Glassfish and Ping the JDBC Connection!

STEP 3: Roller 4

STEP 3.1: Download Roller

Download Roller from here.
For more detailed information about installation refer to the Roller Installation Guide!

STEP 3.2: Create Database
mysql -u root -p

password: *****
create database rollerdb;

grant all on rollerdb.* to scott@'%' identified by 'tiger';

grant all on rollerdb.* to scott@localhost identified by 'tiger';

quit
STEP 3.3: Create roller-custom.properties

To connect to the MySQL database you should create the roller-custom.properties file in either 2 ways “as far as I noticed“:

  • Roller will interact with database Directly:
    installation.type=auto
    database.configurationType=jdbc
    database.jdbc.driverClass=com.mysql.jdbc.Driver
    database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb
    database.jdbc.username=scott
    database.jdbc.password=tiger
    
    mail.configurationType=properties
    mail.hostName=smtp-server.example.com
    mail.username=scott
    mail.password=tiger

    Place it in:

    mv roller-custom.properties $ROLLER_DIR/WEB-INF/classes/
  • Roller will interact with database through the JNDI:
    installation.type=auto
    database.configurationType=jndi
    database.jndi.name=jdbc/rollerdb
    
    mail.configurationType=jndi
    mail.jndi.name=mail/Session
    mail.configurationType=properties
    mail.hostName=smtp-server.example.com
    mail.username=scott
    mail.password=tiger

    Place it in:

    mv roller-custom.properties $ROLLER_DIR/WEB-INF/classes/

    Make sure that the following Descriptor is placed in this directory:

    ls $ROLLER_DIR/WEB-INF/sun-web.xml
STEP 3.4: Deploy Roller

Deployment must be easy and straightforward too from the Admin GUI, or You can place the $ROLLER_DIR in the autodeploy directory if you want just to try it out.

STEP 4: A Problem To Be Avoid

I only got Roller and GlassFishV3 working together by disabling the following JPA configuration and setting its flag to false and then adding it to “roller-custom.properties“:
openjpa.QueryCompilationCache=false

Enjoy blogging ;)

About these ads
  1. Husain Al-Khamis
    December 11, 2009 at 12:09 am

    Please, be informed that by the time this post was published GlassFishV3 Final Version had been just released!

    You can download it from here and just proceed with the steps.

    BR
    Husain

  2. December 29, 2009 at 3:01 pm

    Nice article. Thanks for sharing these with us…

    • Husain Al-Khamis
      December 29, 2009 at 5:59 pm

      My pleasure.
      Any time!

      Husain

  3. January 3, 2010 at 2:22 am

    Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

    • Husain Al-Khamis
      January 4, 2010 at 12:15 am

      I myself agree with you.
      Actually, I wasn’t that serious when I started blogging but now I am!

      Thanks for sharing your opinion.

  4. March 2, 2011 at 3:35 am

    We are IT Outsource Company based in London and provide cheapest staff solution for all your needs. Why are you paying you employees $1000 and $2000 as monthly wages when the same job can be done for $100 or $200 or so contct now. We provide following services. • Programmer/Coder • Web Designer • SEO • Remote Support • Cisco Network Designer • Project Management.

  1. December 12, 2009 at 4:00 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: