Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tomcat 5.5 with native apr support?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1850

PostPosted: Sun Dec 17, 2006 9:55 pm    Post subject: Tomcat 5.5 with native apr support? Reply with quote

I recently installed tomcat 5.5.20 on my development machine, including all the unmasking and the list of dependencies as long as my arm :D. I was curious about the native apr support. I get the messages in the log file explaining that it can't find the native tomcat libraries.

I also see that the 'jni' use flag that apparently used to be used in the tomcat ebuild isn't there.

Has anyone manually compiled and installed the native tomcat libraries after installing tomcat from portage?

Thanks.
Tom
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Mon Dec 18, 2006 2:14 am    Post subject: Reply with quote

I've manually installed tomcat 5.5.x to use APR at work, although we don't use Gentoo there (yet!). I was using it for the OpenSSL support instead of using JSSE using the instructions here. To get it to work I had to add the locations of the APR and JNI lib directories to LD_LIBRARY_PATH in the startup script and add SSLEngine="on" and the SSLCertificateFile and SSLCertificateKeyFile attributes to the SSL Connector part of server.xml.

Hope that helps.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1850

PostPosted: Mon Dec 18, 2006 4:03 am    Post subject: Reply with quote

Thanks for the reply. I'll remember to do that. I'm guessing that compiling it may require telling it a bunch of paths, seeing how gentoo puts tomcat in different directories than the standard tomcat install.

Tom
Back to top
View user's profile Send private message
wltjr
Retired Dev
Retired Dev


Joined: 31 Jan 2006
Posts: 73

PostPosted: Tue Jan 09, 2007 5:34 pm    Post subject: Reply with quote

It's currently hard masked due to apr-1.x being hard masked. But you can unmask both and emerge tomcat-native. If you have a default Tomcat server.xml there is nothing more to do. When you start Tomcat it will look for, find and load libtcnative-1.so. If you have modified your server.xml then you will need to add back the listener, or turn it on for the native library. There is no need to set LD_LIBRARY_PATH or etc. The code does not use it, and libtcnative-1.so is installed in the standard path, and registered with ld.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1850

PostPosted: Wed Jan 10, 2007 6:28 pm    Post subject: Reply with quote

Thanks for the reply. I think I'm missing something here. I've installed tomcat-native, and I do have the default server.xml. However I'm still seeing this in the catalina log file:

Code:
Jan 10, 2007 5:57:31 PM 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: /opt/sun-jdk-1.5.0.09/jre/lib/i386/client:/opt/sun-jdk-1.5.0.09/jre/lib/i386:/opt/sun-jdk-1.5.0.09/jre/../lib/i386


I'm also a bit confused as to why it appears to be specifically looking for the native library in the java library path. Exactly what needs to be enabled in the server.xml? The only thing I see that appears to be related is this:

Code:
<Listener className="org.apache.catalina.core.AprLifecycleListener" />


...and that is in fact enabled. Thanks in advance.

Tom
Back to top
View user's profile Send private message
wltjr
Retired Dev
Retired Dev


Joined: 31 Jan 2006
Posts: 73

PostPosted: Wed Jan 10, 2007 6:39 pm    Post subject: Reply with quote

Interesting your path is not looking in /usr/lib. Mine was by default. Not sure what's up there. In your case I would edit /etc/conf.d/tomcat-5.5 and add LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib or CATALINA_OPTS="-Djava.library.path=/usr/lib". Either of those should get things working for you.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1850

PostPosted: Wed Jan 10, 2007 7:02 pm    Post subject: Reply with quote

Yup...that did it. Thanks!

Tom
Back to top
View user's profile Send private message
whowar
n00b
n00b


Joined: 24 Jun 2005
Posts: 8

PostPosted: Wed Jul 18, 2007 10:22 am    Post subject: root cause of this problem? Reply with quote

I'm using Sun JDK 1.5.0.11 [sun-jdk-1.5] on Gentoo and I'm also getting the same problem. This bug helps to explain why java.library.path only needs updating for some (i.e. those who are not using blackdown's java).

https://bugs.gentoo.org/show_bug.cgi?id=125563
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum