Version 2

    I've had a couple of quite unpleasant hours trying to make APR work under JBoss 7.0.2, sitting on RHEL5 x86 linux machine.


    It works now, and I'd like to give some tips, so I'll be the last one who had to suffer that much


    I'll reffer to JBoss directory as $JBOSS_DIR, just replace it with yours.


    Please note: I'm explaining how I did it for my setup (x86 linux machine). It may differ for other setups and you'll have to adopt  the process for your needs. However, I think this gives the general idea for required steps anyway.


    1. Download the latest native libraries .tar.gz for your machine from

    2. Untar and ungzip it to $JBOSS_DIR (tar xzvf filename.tar.gz). Now you should have a folder called "native" under the $JBOSS_DIR/bin

    3. Add the following to the $JBOSS_DIR/bin/standalone.conf:

    JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/home/myname/tools/jboss701/bin/native:$PATH"

    4. create a symbolic link so the following path


    will link to



    5. Now, the ugliest part.

    If you'll start the JBoss, it shall recognize the native libraries. However, after a few seconds the JVM is going to crash.

    It appears that there is a bug at jbossweb-7.0.1.Final.jar that causes this. To fix this bug, I've had to replace line 536 of with

    return (openSocket) ? SocketState.OPEN : SocketState.CLOSED;


    You can go through the whole mess of downloading the source of JBoss Web 7.0.1, applying the patch and rebuilding the jar or you can just download the attached one I've done for myself and use it.


    Replace the existing $JBOSS_DIR/modules/org/jboss/as/web/main/jbossweb-7.0.1.Final.jar with the fixed one and try again. Now JBoss shall work with apr enabled as it supposed to.


    It was trivial to sort out, doesn't it?