You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Friedrich Clausen <fr...@derf.nl> on 2012/02/24 17:50:24 UTC

Configuration of APR.

Hi All,

I have, to the best of my ability, followed the docs on configuring
APR but I am getting "java.lang.UnsatisfiedLinkError" and, so far, not
been able to resolve it. First, some details of my environment :

OS - RHEL 5 x86_64
Java - 1.6.0_29-b11
Tomcat - 6.0.33
Libs - libtcnative 1.1.20
APR - Distro provided 1.2.7
SSL - Distro provided 0.9.8e

I extracted the bundled native tarball located in bin/ and then ran
configure like so -

$ ./configure --with-java-home=/usr/local/jdk/
--prefix=/usr/local/tomcat/ --with-apr=/usr/bin/apr-1-config
--with-ssl=yes

then "make" and "make install" results in the libtcnative shared libs
being installed in tomcat/lib. I then edit tomcat/bin/setenv.sh to
make sure the various environment variables are set correctly so that
it can find the native libraries. My setenv.sh looks like the
following

CATALINA_OPTS="$CATALINA_OPTS
-Djava.library.path=/usr/local/tomcat/lib:/lib64:/usr/lib64"
LD_LIBRARY_PATH=/usr/local/tomcat/lib:/lib64:/usr/lib64
export LD_LIBRARY_PATH CATALINA_OPTS

I then, for debugging purposes start Tomcat from tomcat/bin with
"catalina.sh run" so that I can see the logging directly. It shows the
following

$ ./catalina.sh runlibtcnative-1.so
LD_LIBRARY_PATH = /usr/local/tomcat/lib:/lib:/usr/lib <-- debugging
added in by me
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Pool.create(J)J
	at org.apache.tomcat.jni.Pool.create(Native Method)
	at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:615)
	at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:107)
	at org.apache.catalina.connector.Connector.initialize(Connector.java:1022)
	at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
	at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
	... 6 more

I am stumped as to why I am getting "UnsatisfiedLinkError" - all
appears to be OK and consistent with what the install guides
recommend. Additionally, ldd does not show any missing dependencies
for libtcnative-1.so -

$ ldd libtcnative-1.so
	libssl.so.6 => /lib64/libssl.so.6 (0x00002b3634271000)
	libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002b36344bd000)
	libapr-1.so.0 => /usr/lib64/libapr-1.so.0 (0x00002b363480e000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b3634a36000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002b3634c51000)
	libc.so.6 => /lib64/libc.so.6 (0x00002b3634e55000)
	libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00002b36351ad000)
	libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00002b36353db000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002b3635670000)
	libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00002b3635873000)
	libz.so.1 => /usr/lib64/libz.so.1 (0x00002b3635a98000)
	libuuid.so.1 => /lib64/libuuid.so.1 (0x00002b3635cac000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b3635eb1000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003dbcc00000)
	libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00002b36360e9000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002b36362f1000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00002b36364f4000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00002b3636709000)
	libsepol.so.1 => /lib64/libsepol.so.1 (0x00002b3636922000)


Any hints would be much appreciated!

Thanks,

Fred.

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


Re: Configuration of APR.

Posted by Friedrich Clausen <fr...@derf.nl>.
Hi,

On Fri, Feb 24, 2012 at 7:38 PM, Konstantin Kolinko
<kn...@gmail.com> wrote:
> Do you have AprLifecycleListener in your server.xml?
> If tomcat-native is unavailable it would fail when listener is
> initialized. Here it fails later - I do not know why.

Thanks! That was it! I thought that AprLifecycleListener was optional
and only to do with explicitly enabling or disabling SSL. As soon as I
configured that everything else worked -

INFO: Loaded APR based Apache Tomcat Native library 1.1.20.

Thanks again for your help with this.

Regards,

Fred.

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


Re: Configuration of APR.

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/2/24 Friedrich Clausen <fr...@derf.nl>:
> Hi All,
>
> I have, to the best of my ability, followed the docs on configuring
> APR but I am getting "java.lang.UnsatisfiedLinkError" and, so far, not
> been able to resolve it. First, some details of my environment :
>
> OS - RHEL 5 x86_64
> Java - 1.6.0_29-b11

Is your /usr/local/jdk  64-bit ?
It has to match the native DLL that you are trying to load in it.


> Tomcat - 6.0.33
> Libs - libtcnative 1.1.20
> APR - Distro provided 1.2.7
> SSL - Distro provided 0.9.8e
>
> I extracted the bundled native tarball located in bin/ and then ran
> configure like so -
>
> $ ./configure --with-java-home=/usr/local/jdk/
> --prefix=/usr/local/tomcat/ --with-apr=/usr/bin/apr-1-config
> --with-ssl=yes
>
> then "make" and "make install" results in the libtcnative shared libs
> being installed in tomcat/lib. I then edit tomcat/bin/setenv.sh to
> make sure the various environment variables are set correctly so that
> it can find the native libraries. My setenv.sh looks like the
> following
>
> CATALINA_OPTS="$CATALINA_OPTS
> -Djava.library.path=/usr/local/tomcat/lib:/lib64:/usr/lib64"
> LD_LIBRARY_PATH=/usr/local/tomcat/lib:/lib64:/usr/lib64
> export LD_LIBRARY_PATH CATALINA_OPTS
>
> I then, for debugging purposes start Tomcat from tomcat/bin with
> "catalina.sh run" so that I can see the logging directly. It shows the
> following
>
> $ ./catalina.sh runlibtcnative-1.so
> LD_LIBRARY_PATH = /usr/local/tomcat/lib:/lib:/usr/lib <-- debugging
> added in by me
> Using CATALINA_BASE:   /usr/local/tomcat
> Using CATALINA_HOME:   /usr/local/tomcat
> Using CATALINA_TMPDIR: /usr/local/tomcat/temp
> Using JRE_HOME:        /usr/local/jdk
> Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Pool.create(J)J
>        at org.apache.tomcat.jni.Pool.create(Native Method)
>        at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:615)
>        at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:107)
>        at org.apache.catalina.connector.Connector.initialize(Connector.java:1022)
>        at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
>        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
>        at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
>        at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
>        ... 6 more
>

Do you have AprLifecycleListener in your server.xml?
If tomcat-native is unavailable it would fail when listener is
initialized. Here it fails later - I do not know why.

Maybe there are other important messages during startup?

> I am stumped as to why I am getting "UnsatisfiedLinkError" - all
> appears to be OK and consistent with what the install guides
> recommend. Additionally, ldd does not show any missing dependencies
> for libtcnative-1.so -
>
> $ ldd libtcnative-1.so
>        libssl.so.6 => /lib64/libssl.so.6 (0x00002b3634271000)
>        libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002b36344bd000)
>        libapr-1.so.0 => /usr/lib64/libapr-1.so.0 (0x00002b363480e000)
>        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b3634a36000)
>        libdl.so.2 => /lib64/libdl.so.2 (0x00002b3634c51000)
>        libc.so.6 => /lib64/libc.so.6 (0x00002b3634e55000)
>        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00002b36351ad000)
>        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00002b36353db000)
>        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002b3635670000)
>        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00002b3635873000)
>        libz.so.1 => /usr/lib64/libz.so.1 (0x00002b3635a98000)
>        libuuid.so.1 => /lib64/libuuid.so.1 (0x00002b3635cac000)
>        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b3635eb1000)
>        /lib64/ld-linux-x86-64.so.2 (0x0000003dbcc00000)
>        libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00002b36360e9000)
>        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002b36362f1000)
>        libresolv.so.2 => /lib64/libresolv.so.2 (0x00002b36364f4000)
>        libselinux.so.1 => /lib64/libselinux.so.1 (0x00002b3636709000)
>        libsepol.so.1 => /lib64/libsepol.so.1 (0x00002b3636922000)
>
>
> Any hints would be much appreciated!
>
> Thanks,
>
> Fred.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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