I basically followed the same set of instructions for Tomcat 5.5.28 on Fedora 
11 for compilation. I use the stock Sun JRE / JDK (1.6.0_18 32 bit), and the 
stock Apache Tomcat 5.5.28 downloaded from tomcat.apache.org.

Compilation went normally, and I put the libraries (with symbolic links) into 
~/Apache/apache-tomcat-5.5.28/bin. I then tried the following four methods to 
load the native libraries.

1. -Djava.library.path set in CATALINA_OPTS in catalina.sh
    
CATALINA_OPTS="-Djava.library.path=/home/mdeggers/Apache/apache-tomcat-5.5.28/bin"

2. -Djava.library.path set in JAVA_OPTS in catalina.sh
    
JAVA_OPTS="-Djava.library.path=/home/mdeggers/Apache/apache-tomcat-5.5.28/bin"

3. export LD_LIBRARY_PATH=/home/mdeggers/Apache/apache-tomcat-5.5.28/bin

4. Placing the library in /usr/local/Sun/jre1.6.0_18/lib/i386/ (reported to be 
on the java.library.path)

In all four cases, the tcnative library failed to load. In the first two cases, 
the INFO message indicated that the library was not found in 
/home/mdeggers/Apache/apache-tomcat-5.5.28/bin. In the last two cases, the INFO 
message listed all directories in java.library.path

The same steps were used to build and deploy the tcnative libraries on Tomcat 
6.0.24. Configurations 1 and 3 from above were tried.

Both worked for Tomcat 6.0.24 as indicated by the INFO message:

INFO: Loaded APR based Apache Tomcat Native library 1.1.19.
Jan 21, 2010 5:48:15 PM org.apache.catalina.core..AprLifecycleListener init 
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], 
random [true].

There seems to be an issue with Tomcat 5.5.28 and the tcnative libraries.

I had a similar experience with Tomcat 5.5.28 under Windows/XP Professional 
(same version of JRE/JDK - obviously for Windows) and the binary download of 
the native libraries.

Tomcat 5.5.28 failed to load the libraries when an environment variable was set 
in catalina.bat.

Tomcat 6.0.24 worked with the native libraries (at least they loaded), but on 
shutdown I received the following SEVERE error.

Jan 21, 2010 2:16:09 PM org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed
org.apache.tomcat.jni.Error: A blocking operation was interrupted by a call to 
WSACancelBlockingCall.  
        at org.apache.tomcat.jni.Socket.accept(Native Method)
        at 
org..apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:
1156)
        at java.lang.Thread.run(Thread.java:619)

I guess it's time to set up debug logging on Tomcat and see if I can figure out 
what's going on.

Any thoughts before I wade into megabytes of logs would be appreciated.

/mde/

--- On Tue, 1/19/10, Christopher Schultz <ch...@christopherschultz.net> wrote:

> From: Christopher Schultz <ch...@christopherschultz.net>
> Subject: Re: TCNative installation failed
> To: "Tomcat Users List" <users@tomcat.apache.org>
> Date: Tuesday, January 19, 2010, 10:57 AM
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Nikolay,
> 
> On 1/19/2010 9:59 AM, Nikolay Diulgerov wrote:
> > I followed this instruction (http://tomcat.apache.org/native-doc/),
> > installed all the required packages for the
> compilation of TCNative
> > (1.1.19),
> > 
> > The configuration, compilation and installation went
> OK.
> 
> Great!
> 
> > Now in my $CATALINA_HOME/lib folder I have
> 
> Where does CATALINA_HOME point?
> 
> > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
> > export LD_LIBRARY_PATH
> 
> That looks good.
> 
> > But when I start tomcat, it seems tcnative library
> cannot be found (so
> > not loaded).
> > 
> > Jan 19, 2010 9:54:13 AM
> org.apache.catalina.core.AprLifecycleListener
> > lifecycleEvent
> > 
> > INFO: The Apache Tomcat Native library which allows
> optimal performance
> > in production environments was not found on the
> java.library.path:
> >
> /appsrv/jdk1.6.0_16/jre/lib/amd64/server:/appsrv/jdk1.6.0_16/jre/lib/amd
> >
> 64:/appsrv/jdk1.6.0_16/jre/../lib/amd64::/appsrv/tomcat/lib:/usr/java/pa
> > ckages/lib/amd64:/lib:/usr/lib
> 
> Is CATALINA_HOME set to "/appsrv/tomcat"? If so, then your
> LD_LIBRARY_PATH appears to be set correctly, which is
> good.
> 
> > Now in my $CATALINA_HOME/lib folder I have
> > 
> > drwxr-xr-x  3 niki niki    4096
> 2010-01-19 09:05 .
> > drwxr-xr-x 13 niki niki    4096 2010-01-19
> 08:43 ..
> > -rw-r--r--  1 niki niki 1574152 2010-01-19 09:05
> libtcnative-1.a
> > -rwxr-xr-x  1 niki niki 
>    911 2010-01-19 09:05 libtcnative-1.la
> > lrwxrwxrwx  1 niki niki      23
> 2010-01-19 09:05 libtcnative-1.so ->
> libtcnative-1.so.0.1.19
> > lrwxrwxrwx  1 niki niki      23
> 2010-01-19 09:05 libtcnative-1.so.0 ->
> libtcnative-1.so.0.1.19
> > -rwxr-xr-x  1 niki niki  889278 2010-01-19
> 09:05 libtcnative-1.so.0.1.19
> > drwxr-xr-x  2 niki niki    4096
> 2010-01-19 09:05 pkgconfig
> 
> The file libtcnative-1.so should be all you need (well,
> plus the file to
> which it points). Everything you have done looks correct. I
> have a few
> possibilities I can think of:
> 
> 1. Your tcnative library doesn't match the architecture of
> the JVM
>    (i.e. JVM is 64-bit while library is
> 32-bit). You can find out what
>    type the library is by doing:
> 
>    $ file
> $CATALINA_HOME/lib/libtcnative-1.so.0.1.19
> 
> 2. You are running under a SecurityManager which does not
> permit you to
>    load that native library from that
> location. Are you using a
>    SecurityManager?
> 
> 3. Your file paths are incorrect. You didn't say explicitly
> what
>    CATALINA_HOME was, but I suspect
> everything is in order.
> 
> Hope that helps,
> - -chris






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

Reply via email to