SpringBoot 启动报错:org.apache.catalina.core.AprLifecycleListener:An incompatible version [1.2.14] of the Apache Tomcat Native library is installed, while Tomcat requires version [1.2.34]
SpringBoot 项目启动成功,但含有报错,日志信息如下:
2024-06-29 23:41:55:672 [main] [ERROR] org.apache.catalina.core.AprLifecycleListener - An incompatible version [1.2.14] of the Apache Tomcat Native library is installed, while Tomcat requires version [1.2.34]
1. 解释
安装了一个不兼容的 Apache Tomcat 原生库版本(1.2.14),而 tomcat 需要一个 1.2.34 版本的 Apache Tomcat 原生库。
2. 什么是 Apache Tomcat Native library?
Apache Tomcat Native Library 是与 Apache Tomcat 一起使用的可选组件,它允许 Tomcat 使用某些本机资源来提高性能,兼容性等 。其实就是说 Apache Tomcat Native Library 使 Tomcat 可以访问 Apache Portable Runtime(APR)库。
3. 什么是 APR?
Apache 的 APR 是一个高度可移植的库,是 Apache HTTP Server 2.x 的核心。提供了卓越的性能,可伸缩性以及与本机服务器技术的更好集成。并且 APR 有许多的用途,包括访问高级 IO 功能,操作系统级功能和本机进程处理。
4. 解决方法
进入下面地址
https://archive.apache.org/dist/tomcat/tomcat-connectors/native/
找到报错信息中对应需要的版本,这里为 1.2.34 版本
点击下载,得到一个 zip 文件,解压后进入 bin 目录。其中内容如下图所示:
当前目录下的 tcnative-1.dll 是 32 位,x64 目录中 tcnative-1.dll 文件是 64 位的。
选择一个复制到 项目所使用的 JDK 的 bin 目录下,重启 SpringBoot 项目即可。
问题解决!
参考:
https://blog.csdn.net/weixin_43533732/article/details/113737941
https://blog.csdn.net/qq_34578500/article/details/86630579
2024年6月30日 00:37