[jboss-user] [Beginner's Corner] - Re: JBoss (Apr) jboss-native :: linux

rbrtfreund do-not-reply at jboss.com
Mon Nov 30 18:03:16 EST 2009


First. PeterJ - I can't tell you how much I appreciate you getting me headed in the right direction! Four days trying to get this setup... frustrated at best! 

Anyway, I finally got what I was looking for with your help ... the output:

server.log

  | 2009-11-30 22:02:58,133 DEBUG [org.apache.catalina.core.AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.18.
  | 2009-11-30 22:02:58,133 INFO  [org.apache.catalina.core.AprLifecycleListener] APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  | 

So.... to hopefully help out the next guy in my situation let me recap what I discovered... 

Getting jboss-native(APR) setup in a linux environment.

1.) My Environment

Some people use a hosting provider who allows you to install JBoss. There are many out there who provide JBoss hosting and like myself I use one of these companies. Now... usually to install JBoss you click a button or follow a set of steps to get your JBoss version installed. My particular steps are to click a button and have JBoss installed. So I do that. Now... what happens? JBoss is installed, you can drop war's , ear's deploy etc... Fine for most. It removes you from having to know how it is set up (nuts + bolts) of your environment / hosting solution. What also is usually the case of these is that they run your JBoss through a wrapper and as a service. Probably some variation of http://wrapper.tanukisoftware.org/doc/english/download.jsp. (I say all this because I think my setup is like a lot who try to setup APR and have issues). Now when debugging why it doesn't work you have extra things (you may consider) when trying to find out why (and i'm no linux expert). So my environment by running (to keep this complete)

  | uname -a
  | Linux [yourdomain].com 2.6.18-028stab064.7 #1 SMP Wed Aug 26 13:11:07 MSD 2009 i686 i686 i386 GNU/Linux
  | 
Also note... It's a CentOS5 setup with jboss (version 4.2.3) running as a service existing at /opt/jboss4/ 

2.) Installing jboss-native (APR) support

So, back to our installing... Per Forums, Docs, Instructions etc... you get directed to http://www.jboss.org/jbossweb/downloads/jboss-native/?action=a&windowstate=maximized to download a jboss-native package for your specific OS / platform. I download the jboss-native binaries - linux2 x86 package. After extraction you will get a directory tree like the following
jboss-native-2.0.8-linux2-x86-ssl
    > bin
        >native
          >engines
            >libarp-1.so 
              (etc...)
    > licenses

jboss-native... or in this case bin/native needs to be placed in ${jboss.home}/bin. So following all the instructions, forums again I do this and it doesn't work. So now what?

3.) Here's what I did... (not sure really what it did but it works).

I placed the native directory in jboss/bin/ like told by forums and instructions. 

Then I ran ldd native/libtcnative-1.so.

  | ldd: warning: you do not have execution permission for `native/libtcnative-1.so'
  |         libssl.so.0.9.8 => not found
  |         libcrypto.so.0.9.8 => not found
  |         libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0xb7eee000)
  |         libuuid.so.1 => /lib/libuuid.so.1 (0xb7eea000)
  |         librt.so.1 => /lib/librt.so.1 (0xb7ee1000)
  |         libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7eb2000)
  |         libpthread.so.0 => /lib/libpthread.so.0 (0xb7e9b000)
  |         libdl.so.2 => /lib/libdl.so.2 (0xb7e97000)
  |         libc.so.6 => /lib/libc.so.6 (0xb7d57000)
  |         /lib/ld-linux.so.2 (0xb7f3c000)
  | 
This pointed me in the direction that libssl.so.0.9.8 and libcrypto.so.0.9.8 were not found. Not sure why? Anyway. So I followed the convention of the .so's that were found and placed libssl.so.0.9.8 and libcrypto.so.0.9.8 in the /usr/lib directory. Then I ran again the ldd native/libtcnative-1.so

  | ldd: warning: you do not have execution permission for `native/libtcnative-1.so'
  |         libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7eb7000)
  |         libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7dbb000)
  |         libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0xb7d93000)
  |         libuuid.so.1 => /lib/libuuid.so.1 (0xb7d8f000)
  |         librt.so.1 => /lib/librt.so.1 (0xb7d86000)
  |         libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7d58000)
  |         libpthread.so.0 => /lib/libpthread.so.0 (0xb7d40000)
  |         libdl.so.2 => /lib/libdl.so.2 (0xb7d3c000)
  |         libc.so.6 => /lib/libc.so.6 (0xb7bfc000)
  |         /lib/ld-linux.so.2 (0xb7f14000)
  | 
As you can see now the two files were found. So thinking all is good I restart jboss4 and look at the output hoping to see  

  | 2009-11-30 22:02:58,133 DEBUG [org.apache.catalina.core.AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.18.
  | 
and I didn't see it I still got... 

  | 2009-11-30 22:54:55,371 DEBUG [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/jboss4/lib
  | 

Noting above that it was looking in java.library.path: /opt/jboss4/lib I copied all the libtcnative-1.so,libtcnative-1.so.0,libtcnative-1.so.0.1.18 into the /opt/jboss4/lib folder and restarted Jboss... This time I got what I was looking for

  | 2009-11-30 22:56:30,083 DEBUG [org.apache.catalina.core.AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.18.
  | 2009-11-30 22:56:30,083 INFO  [org.apache.catalina.core.AprLifecycleListener] APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  | 

Not sure if this is the best way to get it working or even what all those changes did to make it work but hopefully it helps someone save some time.

A side note:
So developing my app is what I originally wanted to do.. Not all this config stuff. So back to the app. Here's a few notes I found when using APR setup like this on a hosting provider. use of mod_proxy and the like proved to work for me and not mod_jk. So if your using JKMount /* ajp13 it may not pick up.. or maybe just me but if so use mod_proxy variants instead.

Much love to the JBoss Forum users for getting back to developing!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268193#4268193

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268193




More information about the jboss-user mailing list