incompatible version [1.1.34] of the APR based Apache Tomcat Native library

14,416

Solution 1

Since the answer was incomplete for me and it is the first thread that google finds for the research i'll say what solves the problem for me.

I had to download the Apache Tomcat Native Library from https://tomcat.apache.org/download-native.cgi then put the content of the bin folder (with the tcnative-1.dll) into the jdk bin folder that i use.

Hope it will help someone!

source: APR version mismatch error upon startup

Solution 2

This is because system installed tomcat(CATALINA_HOME) is conflicting libraries with spring boot tomcat. so to get rid of this error download the native library of required version and replace with bin folder's tcnative-1.dll

download link : https://archive.apache.org/dist/tomcat/tomcat-connectors/native/

Solution 3

The same thing happened to me as well. In my case I had Tomcat 8.0.37 on my machine so it was used (by embedded Tomcat from Spring Boot) via CATALINA_HOME. I checked the version of Tomcat the Spring Boot (in my case 2.0.5.RELEASE) used (it was 8.5.34) and just replaced the old version with the newest one changing CATALINA_HOME as well of course. Then the warning went away.

I assume my approach is better than downloading some native Tomcat libraries and placing them near the JDK.

Solution 4

You probably (improperly) upgraded Tomcat and so you have an old version of the native library. You need to use the version that shipped with your version of Tomcat.

Tomcat ships with native libraries in the bin/ directory of the distribution. Make sure you don't have some old version sitting-around somewhere. You may have to re-build libtcnative from scratch and re-bundle it with your embedded application.

Or, consider going with a non-native solution and switching to Tomcat's NIO connector.

Share:
14,416
alexanoid
Author by

alexanoid

Updated on June 15, 2022

Comments

  • alexanoid
    alexanoid about 2 years

    On my openSUSE Leap 42.3 server during Spring Boot 2.0.0.M6 application startup on Embedded Tomcat server I'm seeing the following error in the logs:

    ERROR 30471 --- [main] o.a.catalina.core.AprLifecycleListener: An incompatible version [1.1.34] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]
    

    Could you please explain what should be fixed there(and where) in order to avoid this error?

  • nightfury
    nightfury over 5 years
    Okay than for linux we have to replace 'libtcnative-1' file correct ?, do I need to generate my tomcat specific 'libtcnative-1' using commands or will it be fine to copy and paste it from source like - archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.‌​32/…
  • Alien
    Alien over 5 years
    copy paste should be fine
  • J E Carter II
    J E Carter II almost 5 years
    The only problem I could see with this is if there is some production code that for one reason or another worked well with the old version but not the new. E.g. you need to regression test to be perfectly safe. While, in practice, I can't guess any actual conflicts this may create, you never know until it throws an error. Otherwise, yes, this is better than shimming with a pasted in .dll.
  • Dmitry Senkovich
    Dmitry Senkovich almost 5 years
    @JECarterII makes sense, of course it may break. But it can break in case of copying the native libraries as well. This is quite tricky change from the following perspective: we don't have full control and vision of the change