0

I have created springboot application. While running the application, it is pointing to environment variable tomcat path and giving error.

Error message :-

The APR based Apache Tomcat Native library failed to load. The error reported was [C:\Tomcat7\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform]

java.lang.UnsatisfiedLinkError: C:\Tomcat7\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[na:1.8.0_131]
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[na:1.8.0_131]
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) ~[na:1.8.0_131]
Girish
  • 33
  • 2
  • 6
  • Check if tomcat is 32 bit version. – Shiva Dec 07 '18 at 10:36
  • to check, start tomcat, and go to task manager. If it's 32-bit it will show *32 suffixed to the process name. Make sure you look at tomcatx.exe and not tomcatxw.exe process. I think on some versions the java process will show up instead of tomcat. – Shiva Dec 07 '18 at 10:39
  • If tomcat is 32 bit version, you should be using 32 bit JDK – Shiva Dec 07 '18 at 10:41

1 Answers1

0

tcnative-1.dll is a Tomcat Native library that takes advantages of the OS native capabilities and is installed separately, either you run Tomcat as a standalone server, or as embedded in your application.

i don't know exactly where embedded Tomcat tries to find this file first, but it makes sense that it would scan e.g. the Windows PATH variable, or any Tomcat related ones. in my case it found it in C:\Windows\System32 - i indeed had a 32-bit version of this file there, apparently from some older Tomcat installation. when i removed it and copied the 64-bit version (from here), the warning went away.

i referenced this post

hello_earth
  • 1,442
  • 1
  • 25
  • 39