在 Spring 工具 Suite/Eclipse 中配置 APR 连接器

Configure APR connector in Spring Tool Suite/Eclipse

我想在 linux(CentOS7) 中的 Spring Tool Suite tomcat 中配置 APR 连接器。

使用 apr 1.5.2,tomcat-native 1.1.33,Spring Tool Suite 3.6.2,tomcat 7.0.57。

遵循此 tutorial and installed apr and tomcat-native libraries. Then based on this question,将 jdk 路径配置为 eclipse tomcat 的配置参数。现在当我启动服务器时,我得到

SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8443]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:821)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:972)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more

感谢任何帮助。

知道了..需要设置tomcat

的环境变量
LD_LIBRARY_PATH - /usr/local/apr/lib

查看此问题的第二个答案link