When I compile my spring mvc app, 开发者_JAVA百科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?
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.
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.
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
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
To get APR
working on a Windows server:
install the APR native libs into the Tomcat
bin
directory (for64 bit
use thetcnative
files in thex64
subfolder)add the Tomcat
bin
folder to the Windows%path%
(this addsopenssl
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
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.
精彩评论