20

When I compile my spring mvc app, I get this in the output:

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_17\bin;......

What exactly should I use in production that this is referring to?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199

6 Answers6

14

Tomcat-native is a version of Tomcat that uses the highly optimized Apache Portable Runtime (APR), the same framework that powers the Apache HTTP server.

Kevin
  • 30,111
  • 9
  • 76
  • 83
6

I found a post out there:

You can safely ignore this message if you want. Basically it is telling you that an optional shared library (dll on Windows) is not found. The APR is the Apache Portable Runtime. This is a native (non-java) library that can improve the performance of Tomcat in certain situations. On both Windows and Unix/Linux you will need a C compiler to build this library.

Aito
  • 6,812
  • 3
  • 30
  • 41
5

Take a look at this talk , http://www.infoq.com/presentations/Tuning-Tomcat-Mark-Thomas , where one of the Tomcat developers discuss how to tune Tomcat - including which of the connectors (Like NIO or APr) to consider. The message you get about APR is referring to Tomcat Native

nos
  • 223,662
  • 58
  • 417
  • 506
3

My case: Seeing the same INFO message.

Centos 6.2 x86_64 Tomcat 8.0.14

This fixed the problem for me:

yum install tomcat-native

Zeeshan Akhter
  • 1,881
  • 20
  • 19
2

To get APR working on a Windows server:

  • install the APR native libs into the Tomcat bin directory (for 64 bit use the tcnative files in the x64 subfolder)

  • add the Tomcat bin folder to the Windows %path% (this adds openssl to your path)

Additional Notes:

You cannot use a Java keystore with the APR connector as it expects certificates in the normal Apache format. To convert a pfx certificate I used:

openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer
openssl pkcs12 -in domain.pfx -nocerts -nodes  -out domain.key
openssl pkcs12 -in domain.pfx -out domain-ca.crt -nodes -nokeys -cacerts

You will then be able to uncomment / enable the example SSL using the APR connector in Tomcat's server.xml

Stuart Cardall
  • 2,099
  • 24
  • 18
1

I was very new to Tomcat and faced the same problem; I think it was because I didn't stop the server properly.

In Eclipse, on the Server tab, right-click Tomcat and click "Clean". Restart the server. It worked for me.

VLS
  • 2,306
  • 4
  • 22
  • 17
Neha Garg
  • 11
  • 1