Skip to content
22

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

22 Comments Post a comment
  1. Aug 29 2010

    great, thx !

  2. frabe
    Sep 2 2010

    Awesome! tks!

  3. Udayraj
    Sep 25 2010

    Great! Very helpful. Thanks a lot!

  4. heperez
    Oct 16 2010

    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.

  5. Nov 2 2010

    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

  6. Nov 4 2010

    Thanks. I just wanted to setup JBoss 5 on Ubuntu. This really saved me some time figuring stuff out.

  7. nam
    Nov 5 2010

    thanks

  8. Surajit Ray
    Nov 19 2010

    @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.

  9. Surajit Ray
    Nov 19 2010

    @Benjamin Was not aware of that. Thanks for pointing it out. Point taken ….

  10. senthil
    Nov 27 2010

    Surajit,

    JBOSS installation instructions are very helpful.

    Thanks,

    Senthil

  11. sadaru
    Dec 3 2010

    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

  12. Carlos Suarez
    Dec 16 2010

    jnet.jar is not present. and the script is not working.

  13. Larry
    Feb 10 2011

    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!

  14. Alok
    Feb 21 2011

    Perfect..!!

    Thanks a lot

  15. Benjamin Lambe
    Mar 31 2011

    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

  16. Luis Laurent
    May 2 2011

    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!

  17. Jun 28 2011

    @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 :)

  18. Lucas
    Aug 29 2011

    @Luis, Benjamin,
    Here is the solution: http://tricky-bits.eu/mind/2008/10/15/cryptic-jboss-error/

  19. Clemens Berndt
    Sep 24 2011

    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

  20. Vivek
    Nov 8 2011

    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.

  21. angolop
    Nov 28 2011

    very helpful

    thanks a lot

  22. Ashish
    Jan 9 2012

    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

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
This site employs the Ravatars plugin.