the lost logbook

Utkarsh's mind.random() on Programming, India and Startups

JMS application on Ubuntu 9.10 using Eclipse Ganymede

leave a comment

If you a windows “power” user, a shift to linux will be really good, but it also comes with little packages of frustration sometimes.

I was trying to install JBOSS 4.3.2 (which was very smooth) and trying to run a JMS application. This is a very easy task in Windows, but since, I am new to linux, some easy tasks became so annoying!!! But later I realized it was much simpler once you get the hang of it. So, here are the steps to run a JMS application on Linux (Ubuntu 9.10)

1. Install JBOSS 4.3.2

Download JBOSS 4.3.2 to your desktop and extract the tar.gz or zip file ot /opt folder in the main file system.

sudo unzip boss-4.2.3.GA-jdk6.zip /opt

And you are done with your JBOSS installation!!

Go to your terminal and type sudo /opt/jboss-4.2.3.GA/bin/run.sh“. This will start you JBOSS server in 20-25 seconds.

2. Configure the environment variable in linux

This was the most annoying part for me since I didn’t know how to set the environment variable in Linux. Though its a very very easy process!

Execute this following code in the terminal:

export CLASSPATH=$CLASSPATH:/CLASSPATH=/opt/jboss-4.2.3.GA/client/jbossall-client.jar
To check if you have set the CLASSPATH correctly, type echo $CLASSPATH and if you see the following, you see this, you have set your classpath correctly!

:/CLASSPATH=/opt/jboss-4.2.3.GA/client/jbossall-client.jar

3. Configure your JMS code (more example) (depends on your code)

Go to Eclipse IDE and import your JMS Code. The most simple code should contain 2 files, a client and a server. Then right click on the project > Build Path > Add External Archives; then browse to the folder where you installed JBOSS, (/opt/jboss-4.2.3.GA/) in our case and then go to client folder and add jbossall-client.jar

/opt/jboss-4.2.3.GA/client/jbossall-client.jar

You are all set to run your first JMS application!

You need to create a topic or queue to run the server, for this start the JBOSS server using:

sudo /opt/jboss-4.2.3.GA/bin/run.sh

  1. Go to http://localhost:8080 in your browser.
  2. Go to JMX console
  3. Scroll down to jboss.mq and click on service=DestinationManager
  4. Scroll down to¬† createTopic() method; type in the topic name you want to create and click “invoke”

4. Integrate JBOSS with Eclipse Ganymede using JBOSS Tools (optional)

If you want to start and stop the JBOSS server from your Eclipse installation then add the JBOSS Tools to eclipse in Help > Software Updates. You can follow the steps given in this tutorial.

Written by Utkarsh

November 6th, 2009 at 10:20 pm

Posted in Linux

Tagged with , , , , ,

Leave a Reply

*

Page optimized by WP Minify WordPress Plugin