You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Winter <an...@gmail.com> on 2013/01/23 21:00:57 UTC

The APR based Apache Tomcat Native library was not found

I have been having problems getting comet to work and decided to try the
APR connector.  So I installed APR from the RPM, version
apr-1.3.9-3.el6_1.2.i686.  I followed instructions that I found locally and
online and compiled up the tomcat-native-1.1.23.  It installed in the
/usr/local/apr/lib folder.  In the tomcat6.conf I set
the JAVA_OPTS="-Djava.library.path=/usr/local/apr/lib"

But I still get the message at start: INFO: The APR based Apache Tomcat
Native library which allows optimal performance in production environments
was not found on the java.library.path: /usr/local/apr/lib

What am I missing?

Re: The APR based Apache Tomcat Native library was not found

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Andrew,

On 1/24/13 12:59 PM, Andrew Winter wrote:
> We have a COBOL back end that handles the core functions of our
> product. The only way we have for the servlet based front end to
> get at that data is via a type 1 odbc driver.  It is a real pain
> because it is not thread safe so we have to funnel all the traffic
> through a single thread.
> 
> Anyway, I got the APR working and managed to fire up Tomcat with
> the APR connector but my original problem (in another email)
> remains. That being that calls to a Comet servlet I created return
> a 400 response saying that the URL does not support get requests.
> I tried NIO first and thought that APR would perhaps solve my
> problem. So now I am giving up and trying to have a go with
> glassfish instead.

Please don't give up on Tomcat just yet. Give the (smarter) Tomcat
devs a chance to take a look at this issue. Comet should be enabled by
default on all connectors, and I don't know why you are getting the
"does not support GET" error.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEBhR8ACgkQ9CaO5/Lv0PDw5ACeI2/XeztcCWgJ4e4PPjXFqLqO
7N8An2+mW7Wn6KZeLxnkRVYG73y6xGsb
=eMT+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: The APR based Apache Tomcat Native library was not found

Posted by Andrew Winter <an...@gmail.com>.
We have a COBOL back end that handles the core functions of our product.
The only way we have for the servlet based front end to get at that data is
via a type 1 odbc driver.  It is a real pain because it is not thread safe
so we have to funnel all the traffic through a single thread.

Anyway, I got the APR working and managed to fire up Tomcat with the APR
connector but my original problem (in another email) remains. That being
that calls to a Comet servlet I created return a 400 response saying that
the URL does not support get requests.  I tried NIO first and thought that
APR would perhaps solve my problem. So now I am giving up and trying to
have a go with glassfish instead.

Thanks for your help!!


On Thu, Jan 24, 2013 at 12:18 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Andrew,
>
> On 1/23/13 9:54 PM, Andrew Winter wrote:
> > Sorry I forgot the versions of things I am using.
> >
> > Tomcat 6.0.36 Red Hat Enterprise Linux Server release 6.2
> > (Santiago) Java 7u11 (32 bit)
> >
> > I think I found the problem, though. I have to run a 32 bit jvm
> > because a COBOL odbc driver we have to use only comes in a 32 bit
> > version. But the Red Hat box is 64 bit and when I ran 'file' on the
> > libtcnative.so I compiled I found that it is 64 bit. So I think I
> > just need to do a little Googling to see how to compile a 32 bit
> > version and it could work.
>
> I think you'll need 32-bit APR and OpenSSL as well, but I've never
> tried to do mixed 32-bit and 64-bit support libraries. libtcnative.so
> absolutely must be 32-bit to be loaded by a 32-bit JVM.
>
> Reading the Debian multi-arch docs (I'm on Debian), it doesn't sound
> like a simple "install -32 libapr"... you'll need a whole set of
> 32-bit support libraries, etc.
>
> What's a COBOL ODBC driver? :(
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEAREIAAYFAlEBbNAACgkQ9CaO5/Lv0PBmMgCfWS3jc3OFGHamEj6vYsKw7Mun
> 9PgAoKzOudT+RxkvNkcu7v0CEPwoXPmK
> =nibJ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: The APR based Apache Tomcat Native library was not found

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Andrew,

On 1/23/13 9:54 PM, Andrew Winter wrote:
> Sorry I forgot the versions of things I am using.
> 
> Tomcat 6.0.36 Red Hat Enterprise Linux Server release 6.2
> (Santiago) Java 7u11 (32 bit)
> 
> I think I found the problem, though. I have to run a 32 bit jvm
> because a COBOL odbc driver we have to use only comes in a 32 bit
> version. But the Red Hat box is 64 bit and when I ran 'file' on the
> libtcnative.so I compiled I found that it is 64 bit. So I think I
> just need to do a little Googling to see how to compile a 32 bit
> version and it could work.

I think you'll need 32-bit APR and OpenSSL as well, but I've never
tried to do mixed 32-bit and 64-bit support libraries. libtcnative.so
absolutely must be 32-bit to be loaded by a 32-bit JVM.

Reading the Debian multi-arch docs (I'm on Debian), it doesn't sound
like a simple "install -32 libapr"... you'll need a whole set of
32-bit support libraries, etc.

What's a COBOL ODBC driver? :(

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEBbNAACgkQ9CaO5/Lv0PBmMgCfWS3jc3OFGHamEj6vYsKw7Mun
9PgAoKzOudT+RxkvNkcu7v0CEPwoXPmK
=nibJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: The APR based Apache Tomcat Native library was not found

Posted by Andrew Winter <an...@gmail.com>.
Sorry I forgot the versions of things I am using.

Tomcat 6.0.36
Red Hat Enterprise Linux Server release 6.2 (Santiago)
Java 7u11 (32 bit)

I think I found the problem, though. I have to run a 32 bit jvm because a
COBOL odbc driver we have to use only comes in a 32 bit version. But the
Red Hat box is 64 bit and when I ran 'file' on the libtcnative.so I
compiled I found that it is 64 bit. So I think I just need to do a little
Googling to see how to compile a 32 bit version and it could work.

Re: The APR based Apache Tomcat Native library was not found

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Andrew,

On 1/23/13 3:00 PM, Andrew Winter wrote:
> I have been having problems getting comet to work and decided to
> try the APR connector.  So I installed APR from the RPM, version 
> apr-1.3.9-3.el6_1.2.i686.  I followed instructions that I found
> locally and online and compiled up the tomcat-native-1.1.23.

What version of Tomcat are you running? What "locally online
instructions" did you find online? Your Tomcat should have come with
tomcat-native.tar.gz in the bin/ directory. That file should contain a
jni/native/BUILDING file that gives simple instructions.

I have a script to test Tomcat builds that compiles and installs
tcnative. The tcnative part of my script looks like this:

OWD=`pwd`
cd "${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native

./configure --with-apr=/usr/bin --with-ssl=yes
- --with-java-home=/usr/lib/jvm/java-6-sun/

cd "${OWD}"

make -C
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native

cp -d
"${BASE_SOURCE_DIR}/output/build/bin/native/tomcat-native-"*/jni/native/.libs/*
"${BASE_SOURCE_DIR}/output/build/bin/native"

All the paths are crazy because I try to build everything in a single
directory so I can blow it all away and re-run it repeatably. But, you
basically run "./configure && make" and then copy the resulting
objects into your java.library.path (which you have as
/usr/local/apr/lib). If I were you, I'd just put them into
CATALINA_HOME/bin so they don't pollute anywhere else.

> It installed in the /usr/local/apr/lib folder.

Hopefully not: tcnative should just produce a series of .so files that
you can drop anywhere you want and then point java.library.path (a JVM
system property) to it.

APR should be installed in /usr/lib and not in /usr/local. Where did
APR end up when you installed the RPM?

> In the tomcat6.conf I set the 
> JAVA_OPTS="-Djava.library.path=/usr/local/apr/lib"

That should be enough to load apr, but tcnative has to load, first.
Where is tcnative*.so?

> But I still get the message at start: INFO: The APR based Apache
> Tomcat Native library which allows optimal performance in
> production environments was not found on the java.library.path:
> /usr/local/apr/lib
> 
> What am I missing?

The good news is that java.library.path is successfully set to
/usr/local/apr/lib. Now -- what's in /usr/local/apr/lib?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAjSMACgkQ9CaO5/Lv0PBSUQCfU8dS7yqMUDqXvE6PPoslVrBJ
NPEAoK8U7A4F/+h7YM92tyVJsGe93f0u
=mzoo
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org