File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat doesn't find my APR libraries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat doesn Watch "Tomcat doesn New topic

Tomcat doesn't find my APR libraries

sumit anand kumar
Ranch Hand

Joined: Apr 28, 2010
Posts: 83
Guys, I downloaded apr-1.4.6.tar.gz and did the following

$ ./configure --prefix=/usr
$ make
$ make test
$ make install

The tests passed and the new libraries got installed in /usr/lib
[root@myinstance lib]# ls *apr*
apr.exp libapr-1.a pkgconfig

Still tomcat doesn't find these libraries and i am getting

Apr 8, 2012 7:17:53 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-sun-
Apr 8, 2012 7:17:53 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080

What to do next
sumit anand kumar
Ranch Hand

Joined: Apr 28, 2010
Posts: 83
Ok got it

Need to do these too

cd /opt/ARA/apache-tomcat/bin/tomcat-native-1.1.20-src/jni/native/
/configure --with-apr=/usr/local/apr --with-java-home=/usr/java/latest
make install
export JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/usr/local/apr/lib"

Guys, if you know any vital info that you need to share please post. I also found that all these steps can be automated to make a rpm out of this. If you know that or any other useful information , please generously share
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

I think you're asking how to make an RPM for this.

Actually, you'd make 2 RPMs. A Source RPM (SRPM) and a distribution RPM.

The RPM process is based on the idea that a general solution is going to be adapted to a specific platform, so the original source code is bundled up with patches that customize the product, build it with the patches applied, then produce the distribution RPM that actually gets installed on the target system(s). That way you don't end up with a massive heap of customized source code that branches from the original product and is harder to keep maintained. As part of the SRPM process, you get an RPM that can be passed around and installed on development systems.

You can generate a distribution RPM without going through the SRPM process (I do it all the time for WAR builds, which use original source and no patches), but it sounds like you'd be better off going the SRPM route anyway. Even if you don't pass around copies of the patched source, the mere fact that you build using patches makes working through SRPM worthwhile.

For best results on RPM building questions, ask them in the Linux/Unix forum, since you'll find more experts on that particular topic over there.

An IDE is no substitute for an Intelligent Developer.
It is sorta covered in the JavaRanch Style Guide.
subject: Tomcat doesn't find my APR libraries
It's not a secret anymore!