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 to /opt folder in the main file system.
sudo unzip jboss-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 your 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 it’s 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
If you see the following, you have set your classpath correctly!
:/CLASSPATH=/opt/jboss-4.2.3.GA/client/jbossall-client.jar
#3. Configure your JMS 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
- Go to http://localhost:8080 in your browser.
- Go to JMX console
- Scroll down to jboss.mq and click on service=DestinationManager
- 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.
