【问题标题】:The APR based Apache Tomcat Native library was not found on the java.library.path warning in Spring Boot Docker App在 Spring Boot Docker App 的 java.library.path 警告中找不到基于 APR 的 Apache Tomcat Native 库
【发布时间】:2020-01-02 15:13:43
【问题描述】:

当我的 Spring Boot 应用程序在 Amazon Corretto Docker 容器中运行时,我看到以下警告-

o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]

【问题讨论】:

    标签: spring-boot docker tomcat native apr


    【解决方案1】:

    我的Dockerfile 的片段:

    FROM amazoncorretto:8
    RUN yum update -y && yum install -y apr-devel && yum install -y openssl-devel && yum install -y gcc && yum install -y make && yum install -y tar && yum install -y gzip
    RUN curl "http://apache.spinellicreations.com/tomcat/tomcat-connectors/native/1.2.23/source/tomcat-native-1.2.23-src.tar.gz" -o ./tomcat-native-1.2.23-src.tar.gz
    RUN tar zxf ./tomcat-native-1.2.23-src.tar.gz -C .
    RUN cd tomcat-native-1.2.23-src/native/
    RUN ./tomcat-native-1.2.23-src/native/configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/lib/jvm/java-1.8.0-amazon-corretto/
    RUN make && make install
    RUN cp -r /usr/local/apr/lib/* /usr/lib/ 
    
            .... MORE
    

    Dockerfile 中添加的上述命令对我有用。感谢以下资源帮助我找到要添加到 Dockerfile 的命令:

    How to install Apache Tomcat Native library

    Find out where JAVA is

    Tomcat Native / OpenSSL in Spring Boot 2.0

    我还没有运行测试来比较结果,看看是否有任何改进。

    【讨论】:

      猜你喜欢
      • 2011-05-15
      • 2013-09-19
      • 1970-01-01
      • 1970-01-01
      • 2012-02-01
      • 1970-01-01
      • 2018-07-14
      • 2011-06-15
      相关资源
      最近更新 更多