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

5

9

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?

Demerit answered 4/2, 2018 at 18:41 Comment(0)
A
5

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

Aestivation answered 14/8, 2018 at 9:52 Comment(1)
Adding the Tomcat Native Library is basically correct, but depending on operating system, different and more complex tasks need to be performed. I am pretty sure the solution provided here only works on Windows, while the original question was about openSUSE Leap 42.3.Arabist
C
5

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/

Commanding answered 17/5, 2018 at 6:56 Comment(2)
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/…Slopwork
copy paste should be fineCommanding
A
5

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

Aestivation answered 14/8, 2018 at 9:52 Comment(1)
Adding the Tomcat Native Library is basically correct, but depending on operating system, different and more complex tasks need to be performed. I am pretty sure the solution provided here only works on Windows, while the original question was about openSUSE Leap 42.3.Arabist
M
4

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.

Mildamilde answered 27/9, 2018 at 13:33 Comment(2)
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.Florey
@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 changeMildamilde
I
1

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.

Incivility answered 6/2, 2018 at 19:20 Comment(0)
S
0

For Spring-boot application, in Ubuntu, I download from https://tomcat.apache.org/download-native.cgi, build it locally(see https://tomcat.apache.org/native-1.3-doc/) and copy .so files into a bin folder inside the spring-boot project directory. And I see:

2024-06-23T12:13:44.468+10:00  INFO 162202 --- [  restartedMain] o.a.catalina.core.AprLifecycleListener   : Loaded Apache Tomcat Native library [2.0.7] using APR version [1.7.0].
Sedge answered 23/6, 2024 at 2:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.