10 Replies Latest reply on Dec 18, 2008 9:26 PM by sgao

    Does JBoss 5.0.0.0GA support Apache Portable Runtime (APR)?

    sgao

      Hi,

      I am able to configure Apache Tomcat Native library 1.1.16 on the top JBoss 4.2.X to 4.3.X based on this wiki page http://www.jboss.org/community/docs/DOC-9912.

      However, I have failed to configure the same APR on the top of JBoss 5.0.0.0_GA with the same steps.

      I am wondering does JBoss 5.0.0.0GA support Apache Portable Runtime (APR)?

      Thanks
      SGAO

        • 1. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
          peterj

          Yes it does. Download and install JBoss Native, it contains APR

          http://www.jboss.org/jbossweb/downloads/jboss-native/

          • 2. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
            sgao

            I have tried that already. However, it doesn't work for me.
            Have you really made it work for you? It works for me under 4.2.X and even 4.3.X EAP as well. Unfortunately, not on the 5.0.0 GA.

            Can you provide me some hints?

            Thanks

            • 3. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
              peterj

              I just now tried it, running 32-bit and 64-bit Windows and Linux. Works fine for me.

              Are you sure you are getting the correct download for your operating system? Also, when I install it, I unzip Native to a temp directory and then copy the contents of native/bin to jboss_home/bin.

              Also, what version of Native are you downloading? 4.2 and 4.3 look for the APR libraries in a different location than what 5.0 does - you need at least Native 2.0.4 (I think) for 5.0.

              • 4. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                sgao

                so you do get some logs like following in your console after deploying APR in 5.0.0GA, right?
                17:35:39,240 INFO [AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.16.
                17:35:39,241 INFO [AprLifecycleListener] APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

                I used the 2.0.6 and did exact same as what you have mentiond, but I only get above log in 4.2.x and 4.3.x but get nothing in 5.0.0GA.

                What I have done is to unpack the win32 package, copy openssl.exe to JBOSS_HOME/bin and copy all other dlls to JBOSS_HOME/bin/native. Does it look good to you?

                Thanks


                • 5. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                  peterj

                  I did some more research. The info message about the APR libraries not being available disappeared in 5.0 GA, and I was basing my conclusions on the fact that I did not see said message.

                  I just now used listdlls and noted that the APR libraries were not loading. Part of the problem is the run.bat file which is looking in the wrong location for the directory. This text:

                  if exist "%JBOSS_HOME%\bin\META-INF\lib\windows-%JAVA_PLATFORM%" (
                   set "JBOSS_NATIVE_HOME=%JBOSS_HOME%\bin\META-INF\lib\windows-%JAVA_PLATFORM%"


                  should be

                  if exist "%JBOSS_HOME%\bin\META-INF\lib\windows\%JAVA_PLATFORM%" (
                   set "JBOSS_NATIVE_HOME=%JBOSS_HOME%\bin\META-INF\lib\windows\%JAVA_PLATFORM%"


                  (A '\' between 'windows' and '%JAVA_PLATFORM%, not a '-')

                  Then the APR libraries load, but I get a pop-ups:

                  "The ordinal 3873 could not be located in the dynamic link library LIBEAY32.dll"

                  This error is preventing the DLL from loading. I was using Native 2.0.6. So I reverted to 2.0.4 (there is no 2.0.5 for 32-bit Windows). Same problem.

                  I tried 2.0.1, the libraries loaded but I am getting:

                  16:40:23,398 ERROR [Http11AprProtocol] Error initializing endpoint
                  org.apache.tomcat.jni.Error: An address incompatible with the requested protocol
                   was used.
                   at org.apache.tomcat.jni.Socket.create(Native Method)
                   at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:600)
                   at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.jav
                  a:107)
                   at org.apache.catalina.connector.Connector.initialize(Connector.java:102
                  9)
                   at org.apache.catalina.core.StandardService.initialize(StandardService.j
                  ava:683)
                   etc etc etc


                  So it does not look good, at least for 32-bit Windows. Time to reboot and try on other platforms.

                  • 6. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                    peterj

                    OK, I'm running 64-bit Vista now. APR loads just fine. I can see the APR DLLS in Process Explorer (even libeay32.dll loaded!). There is no indication in the console log or the server that APR loaded (such a notice sure would be nice - hint, hint).

                    Of course, I am using my modified run.bat that correct the location of the APR libraries.

                    Next up, 32-bit Linux.

                    • 7. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                      peterj

                      On 32-bit Linux (Kubuntu 8.04), I see that the x86 directory is being added to the ld_library_path (so at least run.sh is looking in the right place for the shared objects), and using pmap I see the libraries in the process address space.

                      Score so far:

                      32-bit windows: broke
                      64-bit windows: works
                      32-bit linux: works

                      Time to reboot and check 64-bit linux.

                      • 8. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                        peterj

                        I had high hopes for 64-bit Linux, but alas it too failed. The run.sh script found the shared library directory and set the java.library.path, but pmap did not show any of the APR libraries being loaded.

                        Of course, having the AprLifecycleListener being completely silent does not help.

                        Final score:

                        32-bit windows: broke
                        64-bit windows: works
                        32-bit linux: works
                        64-bit linux: broke

                        A quick run with 5.0 CR2 on 64-bit Linux shows this entry in the console log:

                        18:06:07,696 INFO [AprLifecycleListener] Loaded Apache Tomcat Native library 1.1.15.

                        And pmap shows that the APR libraries were loaded.

                        • 9. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                          peterj

                          Just noticed something regarding 64-bit Linux. I ran GA with 2.0.6 but CR2 with 2.0.5. So I copied the 2.0.5 files to GA and now it loads APR. So at least on 64-bit Linux the problem is not with JBoss AS, but rather with JBoss Native.

                          So updated score:

                          32-bit windows: broke (Native 2.0.4 and 2.0.6 **)
                          64-bit windows: works (Native 2.0.6)
                          32-bit linux: works (Native 2.0.6)
                          64-bit linux: works with Native 2.0.5 (broke on Native 2.0.,6)

                          ** There is no 2.0.5 for 32-bit Windows, and now I know why - it is broke but no-one told the person who packaged 2.0.6...

                          • 10. Re: Does JBoss 5.0.0.0GA support Apache Portable Runtime (AP
                            sgao

                            Yes, it looks a issue from JBoss native not JBoss AS.

                            JBoss 4.3 EAP does not provide JBoss Native support. Future 5.0 EAP may provide its support, but it has not been out yet.

                            How do we solve this problem?

                            thanks