MAC OS X - Adding Apache Portable Runtime (APR) to JBoss

    1) Install the latest version of MacPorts.

    http://www.macports.org/

    2) Quit and Reopen your Terminal program. From the Terminal, enter:

     

     

    Code:
    sudo port install tomcat-native
         


    3) From the Terminal program, make symbolic links from the /opt/local/lib/libtcnative-1.* to /usr/lib/java:

     

    Code:
    sudo ln -s /opt/local/lib/libtcnative-1.* /usr/lib/java
         

     

     

    4) Restart JBoss and verify:

     

     

    [AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.14.

     

     

    The following is another way of configuring the Apache Native Library on MAC OS X:

     

    1)download JBoss Native 2.0.6 MacOSX x86 from
    http://jboss.org/jbossweb/downloads/jboss-native/

     

    2) copied- jboss-native-2.0.6-macosx-x86-ssl/bin/META-INF/lib/macosx/x86/*.dylib to JBOSS_HOME/bin/native.

     

    3)Copy
    jboss-native-2.0.6-macosx-x86-ssl/bin/META-INF/lib/macosx/x86/engines, directory
    to JBOSS_HOME/bin/native/engines

     

    4)Copy jboss-native-2.0.6-macosx-x86-ssl/bin/META-INF/bin/macosx/x86/openssl

    to JBOSS_HOME/bin

     

    5) edit run.sh (vi run.sh), Add following lines under "# Setup JBosst Native library path", part of the script:

     

    JBOSS_NATIVE_DIR="$JBOSS_HOME/bin/native"

    if [ -d "$JBOSS_NATIVE_DIR" ]; then

        if $cygwin ; then

            export PATH="$JBOSS_NATIVE_DIR:$PATH"

            JBOSS_NATIVE_DIR=`cygpath --dos "$JBOSS_NATIVE_DIR"`

        fi

        if [ "x$LD_LIBRARY_PATH" = "x" ]; then

            LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR"

        else

            LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR:$LD_LIBRARY_PATH"

        fi

        export LD_LIBRARY_PATH

        if [ "x$DYLD_LIBRARY_PATH" = "x" ]; then

            DYLD_LIBRARY_PATH="$JBOSS_NATIVE_DIR"

        else

            DYLD_LIBRARY_PATH="$JBOSS_NATIVE_DIR:$DYLD_LIBRARY_PATH"

        fi

        export DYLD_LIBRARY_PATH

        if [ "x$JAVA_OPTS" = "x" ]; then

            JAVA_OPTS="-Djava.library.path=$JBOSS_NATIVE_DIR"

        else

            JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JBOSS_NATIVE_DIR"

        fi

    fi

     

    The lines in bold font has to be added to the script.

     

    6)Restart your application server, Verify for the following message:
    [AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.16.