SpringBoot内置tomcat出现error:An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]。解决办法
启动tomcat过程中,发现经常出现一个错误,
2018-03-20 13:32:01.022 ERROR 13152 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]
原因分析:
字面意思就是当前版本为1.1.32,需要重新下载1.2.14以上版本。分析SpringBoot的tomcat为内置环境,所以将新版本文件放在java安装目录下即可。
Apache把 httpd的底层库与上层应用逻辑分离,底层库单独发行,底层这就是Apache Portable Runtime Library,简称APR。
APR在跨平台方面,支持多种平台,主要有:
UNIX variants Windows Netware Mac OS X OS/2
APR把很多常用功能都封装好了,内容非常丰富,主要有:
Atomic operations
Dynamic Shared Object loading
File I/O
Locks (mutexes, condition variables, etc)
Memory management (high performance allocators)
Memory-mapped files
Multicast Sockets
Network I/O
Shared memory
Thread and Process management
Various data structures (tables, hashes, priority queues, etc)
解决办法:
1.下载对应版本文件,链接如下:
http://archive.apache.org/dist/tomcat/tomcat-connectors/native/
2.解压后,在bin目录下找到tcnative-1.dll文件,我springboot环境为win10,64位系统,选择了x64文件下的dll文件。
3.将dll文件保存到jdk的bin目录中或者是jre的bin目录中,前提要求java的环境变量已经设置好(在高级设置-环境变量中设置查看)。
4.重新启动SpringBoot程序,即可。
2018-03-20 13:53:44.909 INFO 1728 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : Loaded APR based Apache Tomcat Native library [1.2.14] using APR version [1.6.2].
启动信息可以看出,版本信息为1.6.2,错误消息没了。