AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Building Tomcat tcnative module on AIX

    Posted Tue April 06, 2021 03:41 AM
    Edited by Grant Cotton Tue April 06, 2021 04:02 AM
    I am attempting to get the HTTP/2 connector working in Tomcat9 on AIX (e.g. powerpc-ibm-aix7.2.5.0). This requires the tcnative module. Following the instructions here using tomcat-native-1.2.24-src that comes with Tomcat 9.0.37, along with APR 1.5.2, OpenSSL 1.0.2, IBM Java 1.8.0_261 i.e.

    $ export CFLAGS=-maix64
    $ ./configure --with-apr=/opt/freeware/bin/apr-1-config_64 --with-java-home=/app/java8_64/ --with-ssl=/usr/include/openssl --prefix=/app/tomcat

    followed by

    make && make install

    This creates the expected entries in /app/tomcat/lib, i.e.

    -rw-r--r-- 1 usrxxx grpxxxx 3440287 Mar 03 16:47 libtcnative-1.a
    -rwxr-xr-x 1 usrxxx grpxxxx 1057 Mar 03 16:47 libtcnative-1.la
    lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so -> libtcnative-1.so.0.2.24
    lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so.0 -> libtcnative-1.so.0.2.24
    -rwxr-xr-x 1 usrxxx grpxxxx 1372146 Mar 03 16:47 libtcnative-1.so.0.2.24

    but when Tomcat starts I get

    04-Mar-2021 15:30:00.752 WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native library failed to load. The error reported was [tcnative-1 (Not found in java.library.path)]
    java.lang.UnsatisfiedLinkError: tcnative-1 (Not found in java.library.path)
    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1462)
    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1414)
    at java.lang.System.loadLibrary(System.java:584)
    at org.apache.tomcat.jni.Library.<init>(Library.java:69)
    at org.apache.tomcat.jni.Library.initialize(Library.java:206)
    at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:198)
    ...
    04-Mar-2021 15:30:01.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.library.path=/app/java8_64/jre/lib/ppc64/compressedrefs:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/lib/ppc64/j9vm:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/../lib/ppc64:/app/java8_64/jre/lib/icc:/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/usr/lib64:/app/tomcat/lib:/usr/lib64:/usr/lib
    ...
    04-Mar-2021 15:30:02.233 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]] org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:1024)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1057)

    It may be a 64 vs 32 bit issue but the above configure and make only seems to build a 32 bit module:

    $ dump -H -X64 libtcnative-1.so.0.2.24

    libtcnative-1.so.0.2.24:
    dump: libtcnative-1.so.0.2.24: 0654-108 file is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.

    $ dump -H -X32 libtcnative-1.so.0.2.24

    libtcnative-1.so.0.2.24:

    ***Loader Section***
    Loader Header Information
    VERSION# #SYMtableENT #RELOCent LENidSTR
    0x00000001 0x00000364 0x00000771 0x00000084

    #IMPfilID OFFidSTR LENstrTBL OFFstrTBL
    0x00000007 0x0000aacc 0x00006406 0x0000ab50


    ***Import File Strings***
    INDEX PATH BASE MEMBER
    0 /opt/freeware/lib:/usr/lib:/lib
    1 libssl.so
    2 libcrypto.so
    3 libapr-1.so
    4 libpthread.a shr_xpg5.o
    5 libc.a shr.o
    6 libgcc_s.a shr.o

    My AIX developer knowledge is very limited. Any thoughts on how to proceed?

    ------------------------------
    Grant Cotton
    ------------------------------


  • 2.  RE: Building Tomcat tcnative module on AIX

    Posted Tue April 06, 2021 03:46 AM
    Use "--with-apr=/opt/freeware/bin/apr-1-config_64" and export OBJECT_MODE=64. 


    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: Building Tomcat tcnative module on AIX

    Posted Tue April 06, 2021 04:02 AM
    Thanks. Actually have tried "--with-apr=/opt/freeware/bin/apr-1-config_64" before but not the "export OBJECT_MODE=64"

    but same outcome

    bash-5.0$ dump -H -X64 /app/tomcat/lib/libtcnative-1.so.0.2.24

    /app/iiq/tomcat/lib/libtcnative-1.so.0.2.24:
    dump: /app/iiq/tomcat/lib/libtcnative-1.so.0.2.24: 0654-108 file is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.

    ------------------------------
    Grant Cotton
    ------------------------------