JBOSS 5.1 on Ubuntu 10.04
Requirements : JDK 6
Ubuntu : 10.04
Download Jboss from link : JbossDownload
Create Directory :
sudo mkdir /usr/local/jboss
Extract contents of the downloaded file into this directory
sudo unzip [downloaded_file_name]
Add user called jboss with this command :
sudo useradd -d /usr/local/jboss -s /bin/sh jboss
Now set ownership of this directory to jboss :
sudo chown -R jboss:jboss /usr/local/jboss
Make a copy of the jboss_init_redhat.sh in the bin directory like so
sudo cp /usr/local/jboss/bin/jboss_init_redhat.sh /usr/local/jboss/bin/jboss_init_ubuntu.sh
Now edit this script to make certain changes
sudo gedit /usr/local/jboss/bin/jboss_init_ubuntu.sh
To set the correct path for Java — > Change line
JAVAPTH=${JAVAPTH:-”/usr/local/jdk/bin”}
to
JAVAPTH=${JAVAPTH:-”/usr/bin”}
And change line
JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b $JBOSS_HOST”}
To
JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b 0.0.0.0″}
Explanation : This binds it on all IP addresses. To bind to a specific address, replace the 0.0.0.0.
Now copy this file to the startup scripts folder
sudo cp /usr/local/jboss/bin/jboss_init_ubuntu.sh /etc/init.d/jboss
To add Jboss to the init system
sudo update-rc.d jboss defaults
Result :
update-rc.d: warning: /etc/init.d/jboss missing LSB information
update-rc.d: see
Adding system startup for /etc/init.d/jboss …
/etc/rc0.d/K20jboss -> ../init.d/jboss
/etc/rc1.d/K20jboss -> ../init.d/jboss
/etc/rc6.d/K20jboss -> ../init.d/jboss
/etc/rc2.d/S20jboss -> ../init.d/jboss
/etc/rc3.d/S20jboss -> ../init.d/jboss
/etc/rc4.d/S20jboss -> ../init.d/jboss
/etc/rc5.d/S20jboss -> ../init.d/jboss
Note : In case you want to remove previous instances of Jboss in the init system run :
sudo update-rc.d -f jboss remove
Now just to be sure about the permissions
sudo chown -R jboss:jboss /usr/local/jboss
sudo chmod -R 755 /usr/local/jboss
Now you can start the server by
sudo /etc/init.d/jboss start
And stop the server by
sudo /etc/init.d/jboss stop


great, thx !
Awesome! tks!
Great! Very helpful. Thanks a lot!
I think, better than copy jboss_init_ubuntu.sh to the startup folder is make a symbolic link to this folder:
sudo ln -s /usr/local/jboss/bin/jboss_init_ubuntu.sh /etc/init.d/jboss
with this variant, every change you have to made in the original script will be reflected in the script in the startup folder.
It’s a contribution.
Regards.
You said one should change the JBOSS_BIND_ADDR to the following line:
JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b 0.0.0.0″}
however, this is incorrect. the ‘+’ indicates ‘append to’ which means the 0.0.0.0 will only be used if JBOSS_HOST is not null. The correct line is:
JBOSS_BIND_ADDR=${JBOSS_HOST:-”-b 0.0.0.0″}
which means the bind value 0.0.0.0 will be used if no other has been specified via JBOSS_HOST
Thanks. I just wanted to setup JBoss 5 on Ubuntu. This really saved me some time figuring stuff out.
thanks
@heperez Thanks. Thats a good idea. But given the fact that I usually dont mess around with the script once working – its bit of an overkill. Nonetheless for those users who like to experiment with the startup script (for dev reasons maybe ?) – this is a good way to make things work.
@Benjamin Was not aware of that. Thanks for pointing it out. Point taken ….
Surajit,
JBOSS installation instructions are very helpful.
Thanks,
Senthil
i got error try to start jboss
sudo /etc/init.d/jboss start:
JBOSS_CMD_START = cd /usr/local/jboss/bin; /usr/local/jboss/bin/run.sh -c default
Unknown id: jboss
jnet.jar is not present. and the script is not working.
Thanks for the great post.
I’m getting an error trying to start JBoss:
# sudo /etc/init.d/jboss start
-su: -c: line 0: syntax error near unexpected token `2′
-su: -c: line 0: `cd /usr/local/jboss-6.0.0.Final/bin; /usr/local/jboss-6.0.0.Final/bin/run.sh -c default -b 0.0.0.0 > 2>&1 &’
(Running Ubuntu server 10.10 and JBoss AS 6.0)
Anyone know what’s going on here?
Thanks!
Perfect..!!
Thanks a lot
I am getting the same error as sadaru…
JBOSS_CMD_START = cd /usr/local/jboss/bin; /usr/local/jboss/bin/run.sh -c default -b “ipaddress”
if i then run this like it says it takes 20 minutes to start with lots of errors about preconditions and then wont accept connections anyway.
i am using ubuntu server 10.4 with java 6 and jboss as 6
Im having the same problem
JBOSS_CMD_START = cd /usr/local/jboss/bin; /usr/local/jboss/bin/run.sh -c default
No directory, logging in with HOME=/
any idea??
thanks in advance!
@Benjamin point was good, it fixed the issue i was getting to access my jboss in a VPS remotely, thanks to you both for this great guide and advice respectively
@Luis, Benjamin,
Here is the solution: http://tricky-bits.eu/mind/2008/10/15/cryptic-jboss-error/
I would recommend using the following:
#define the IP address to which to bind jboss, specify 0.0.0.0 to listen on all IP addresses
JBOSS_HOST=${JBOSS_HOST:-”0.0.0.0″}
#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b $JBOSS_HOST”}
Instead of
JBOSS_BIND_ADDR=${JBOSS_HOST:-”-b 0.0.0.0″}
to be more explicit
Hi,
Just unzip the file on your documents folder and then configure jboss through the plugin of eclipse.
It worked for me on ubuntu 32bit .
Make sure you have EE version of eclipse.
very helpful
thanks a lot
Hi all ,
Im having the same problem
JBOSS_CMD_START = cd /usr/local/jboss-4.0.5.GA/bin; /usr/local/jboss-4.0.5.GA/bin/run.sh -c default -b -b 0.0.0.0
No directory, logging in with HOME=/
I have tried everything but unable to get the solution. Can anyone Please help me to start jboss.
thanks in advance!
Regards,
Ashish