SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

在启动SpringBoot程序当中,日志记录当中有下面一条记录:

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

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.8.0_131\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Python36\Scripts\;C:\Program Files\Python36\;
C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files\Java\jdk1.8.0_131\bin;C:\Program Files\Java\jdk1.8.0_131\jre\bin;
C:\My Program Files\apache-maven-3.3.9\bin;C:\Program Files\MySQL\MySQL Utilities 1.6\;
C:\My Program Files\erl9.0\bin;C:\My Program Files\rabbitmq_server-3.6.10\sbin;
C:\My Program Files\rabbitmq_server-3.6.10\ebin;C:\Program Files\TortoiseSVN\bin;
C:\My Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Python36\Scripts;;.]

经研究发现,是系统当中缺少文件,这两个文件的作用是:

1.Tomcat可以使用Apache Portable Runtime(APR)提供优越的可伸缩性、性能和更好的与本地服务器技术的集成。

Apache Portable Runtime是一个具有高度的可移植性库的核心是Apache HTTP Server 2. x。

APR有许多用途,包括访问高级IO功能(如sendfile epoll和OpenSSL),操作系统级别的功能(随机数生成、系统状态等),

和本地流程处理(共享内存,NT管道和Unix套接字)。这些特性可以使Tomcat通用网络服务器,将使更好的与其他本地web技术,

集成和整体让Java更可行的为一个网络服务器平台的成熟而不是简单的后端技术。

2.提升比较多的是对ssl的处理效率,当tomcat处理https的请求是,如果使用本地的openssl库,肯定会比前面提升的效率高。

如何处理

1.打开http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.2.14/binaries/,点击下载。

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

2.下载下来的文件解压出来,假如电脑是64位的(现在的电脑基本都是),按照下图选择

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

3.打开文件夹,复制里面的两个文件,到C:\Windows\System32里面去

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in

4.重新启动程序,发现启动一切正常

SpringBoot2.0启动日志中出现The APR based Apache Tomcat Native library which allows optimal performance in