File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes APR based Apache Tomcat Native library which allows optimal performance in production environments w Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "APR based Apache Tomcat Native library which allows optimal performance in production environments w" Watch "APR based Apache Tomcat Native library which allows optimal performance in production environments w" New topic
Author

APR based Apache Tomcat Native library which allows optimal performance in production environments w

siddharth das
Ranch Hand

Joined: Aug 17, 2007
Posts: 124
Hi,

When I start tomcat server in eclipse,in console I get following..

"INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_23\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.6.0_23/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_23/bin/../jre/bin;C:\Program Files\Java\jdk1.6.0_23\bin;F:\oracle\product\10.1.0\Db_1\bin;F:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client;F:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;"

What does it mean?
Will I need to set the path..
Please tell me.
Thanks
Siddharth
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16022
    
  20

Tomcat has an optional accelerator component that can improve performance. If you do not include that component, you will get this message, but it can be safely ignored. Unfortunately, there is no way to turn it off other than to include the accelerator component.

The accelerator is not worth the trouble in most cases. It requires that you have Apache source code to compile against and be comfortable with building binary modules for the target OS.


Customer surveys are for companies who didn't pay proper attention to begin with.
Chris Beckey
Ranch Hand

Joined: Jun 09, 2006
Posts: 116

Summary
First, ignore all this for development unless you have a reason to use the unique capabilities of the native code libraries.
Second, you can safely ignore all of this production if you don't need the performance the native libraries provide or some unique capability of the native libs.
Third, if you do use the native libraries then test in that configuration during development (personal experience talking here)
Fourth, to use the native libraries you must have: tcnative-1 XOR (libtcnative-1 AND libeay32 AND libapr-1) in your path. tcnative-1 is searched for first and if found, libtcnative-1 is not used.

Gory Details
Tomcat is looking for one of two files, either tcnative.dll or libtcnative-1.dll (assuming Windows extension names) in your PATH. If one of these is found then it will use native code for the sockets. That behavior can be controlled by specifying the class name of the protocol implementation in your connector elements in server.xml. e.g.

will use native sockets.

tcnative-1 is usually in the Tomcat distribution, look in your Tomcat bin directory. tcnative-1 is a grouping of libtcnative-1, libeay32 (the OpenSSL library) and libapr-1 (the Apache runtime libray) and can be used by itself to enable native sockets. If libtcnative-1 is loaded, and not tcnative-1, then libeay32 and libapr-1 must also be available because libtcnative-1 depends on them.
In production it is recommended that the three libraries be used individually so that patches may be applied to each library as needed. Doing so requires building the libraries but that is really not so bad. The source code distributions contain build instructions. If you either have or have access to some C/C++ experience then it is even easier. Just allocate a day or so to collect all the required tools and to set up the environment, after that it is just a couple of command lines.>
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

Where do you find libeay32? I've tried building openssl from source on Linux, and still have no libeay32 library. I have both the apr-1 and libtcnative-1 in the java.library.path, and it's still not happy without this mysterious libeay32.

I am starting to wonder if Tomcat Native is a "white whale".


OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
Chris Beckey
Ranch Hand

Joined: Jun 09, 2006
Posts: 116

I believe that the build instructions with open SSL will tell you where the Linux libs end up after the build. On windows, they are in the out32dll directory under the root of the OpenSSL install directory. Are you sure you are getting a successful build? libeay is the OpenSSL library itself.
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

openssl-0.9.8s builds two libraries on Linux: libcrypto.a and libssl.a . No libeay. I even looked through the Makefile to see if there were other build options, no luck.

-- update --

I did learn later that I shouldn't be looking for libeay ...

From http://www.openssl.org/support/faq.html :
For information on parts of libcrypto that are not yet documented, you might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's predecessor, at http://www.columbia.edu/~ariel/ssleay/. Much of this still applies to OpenSSL.

There is some documentation about certificate extensions and PKCS#12 in doc/openssl.txt

The original SSLeay documentation is included in OpenSSL as doc/ssleay.txt. It may be useful when none of the other resources help, but please note that it reflects the obsolete version SSLeay 0.6.6.


Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

Well, I feel sheepish!

Turned out my problem is that my 32-bit JVM wouldn't use my 64-bit native tomcat library. Go figure! Moving to 64-bit java solved my issue.
Rudra Nath
Greenhorn

Joined: May 12, 2012
Posts: 9
I added following elements in my server.xml:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" />
tcnative-1.dll is present in my tomcat/bin.
but after adding above element in my server.xml, tomcat is not running properly.
please help.
uju nanavare
Greenhorn

Joined: Nov 17, 2011
Posts: 15

Me too facing same prob. I do have 64 bit java, still dont know what is wrong with it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: APR based Apache Tomcat Native library which allows optimal performance in production environments w