4

我下载了 Apache Tomcat 7.x。当我在 Eclipse 中添加这个 Tomcat 时,我得到了这个错误:

Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17 
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 25, 2011 3:21:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3054 ms
Jan 25, 2011 3:21:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 25, 2011 3:21:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 25, 2011 3:21:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 251 ms

我怎么解决这个问题?

当我打开它时,localhost:8080/manager/html它显示以下错误:

HTTP Status 404 - /manager/html

type Status report

message /manager/html

description The requested resource (/manager/html) is not available.
Apache Tomcat/7.0.6
4

2 回答 2

5

第一个错误听起来像是版本不匹配。APR 库是在运行时根据您的路径链接的库(它本身可以基于您执行 Tomcat 的位置)。听起来您拥有 Tomcat 6 的 APR 库。Eclipse 可能正在提供此 APR 库。

Tomcat 附带了一个 APR 库,但为了简化安装,Tomcat 不会自动修改指向 APR 库的路径。Eclipse Tomcat 集成可能(我不确定这一点,以前没有使用过集成)包括 APR 库,以便更容易使用 Tomcat。

检查并确保 Eclipse 未配置为使用早期版本的 Tomcat,如果是,请将 Eclipse 升级到 Tomcat 7 或将 Tomcat 降级到 Eclipse 中指定的版本。

如果您无法弄清楚,那么您现在不必担心。Tomcat 应该在没有 APR 库的情况下仍然可以工作。您将从 APR 库中获得的唯一好处是提高了性能,因为这可能是您项目的开始,不必立即解决。

第二个问题,/manager/ 页面,可能是 Tomcat 配置。除非用户配置了管理员权限,否则 Tomcat 不会真正显示管理员页面(它会给你这个错误)。

尝试只访问 / (即http://localhost:8080),无论用户配置如何,该页面都应该加载。

于 2011-01-25T14:44:28.413 回答
3

在我的情况下,当我使用包管理器在我的 Linux 上本地安装一次 Tomcat 时,我无意中安装了 APR 库。在 Debian/Ubuntu 上,这为导致此错误的不同 Tomcat 版本(与您的发行版捆绑的版本)安装了 APR 包。

简单之后

sudo apt-get purge libtcnative-1

错误消失了。

于 2013-11-07T16:16:09.567 回答