Spring Boot 不能加载 tcnative-2.dll 库

本文将介绍怎样解决 Spring Boot 在启动时抛出 “org.apache.tomcat.jni.LibraryNotFoundError: Can't load library: *\tcnative-2.dll”错误。

在使用SpringBoot3创建项目的过程中,将日志的级别调为debug,日志打印了 “org.apache.tomcat.jni.LibraryNotFoundError: Can't load library: *\tcnative-2.dll”错误。

2024-06-06T15:22:33.222+08:00 DEBUG 19352 --- [           main] o.a.catalina.core.AprLifecycleListener   : The Apache Tomcat Native library could not be found using names [tcnative-2, libtcnative-2, tcnative-1, libtcnative-1] on the java.library.path [E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;.]. The errors reported were [Can't load library: E:\code\IdeaProjects\lease\bin\tcnative-2.dll, Can't load library: E:\code\IdeaProjects\lease\bin\libtcnative-2.dll, Can't load library: E:\code\IdeaProjects\lease\bin\tcnative-1.dll, Can't load library: E:\code\IdeaProjects\lease\bin\libtcnative-1.dll, no tcnative-2 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no libtcnative-2 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no tcnative-1 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no libtcnative-1 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;.]

org.apache.tomcat.jni.LibraryNotFoundError: Can't load library: E:\code\IdeaProjects\lease\bin\tcnative-2.dll, Can't load library: E:\code\IdeaProjects\lease\bin\libtcnative-2.dll, Can't load library: E:\code\IdeaProjects\lease\bin\tcnative-1.dll, Can't load library: E:\code\IdeaProjects\lease\bin\libtcnative-1.dll, no tcnative-2 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no libtcnative-2 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no tcnative-1 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;., no libtcnative-1 in java.library.path: E:\SDK\Java\temurin\jdk-17.0.10+7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;E:\Git\cmd;C:\Windows\system32;E:\SDK\Java\temurin\jdk-21.0.2+13\bin;C:\Windows;E:\apache\apache-maven-3.9.6\bin;E:\mysql\bin;E:\dotnet;E:\pnpm;E:\nvm;E:\nodejs;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;E:\platform-tools;C:\ProgramData\chocolatey\bin;D:\NetSarang\Xshell\;D:\NetSarang\Xftp\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;E:\TortoiseSVN\bin;D:\Snipaste;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Docker\Docker\resources\bin;E:\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\zjw\AppData\Local\Programs\Ollama;E:\VSCode;C:\Program Files\WireGuard\;E:\Python\Python311;E:\Python\Python311\Scripts;E:\gradle\gradle-8.7\bin;E:\nvm;C:\Users\zjw\AppData\Local\JetBrains\Toolbox\scripts;;.
at org.apache.tomcat.jni.Library.<init>(Library.java:91) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.tomcat.jni.Library.initialize(Library.java:147) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:189) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:106) ~[tomcat-embed-core-10.1.24.jar:10.1.24]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getDefaultServerLifecycleListeners(TomcatServletWebServerFactory.java:191) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.<init>(TomcatServletWebServerFactory.java:138) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat.tomcatServletWebServerFactory(ServletWebServerFactoryConfiguration.java:73) ~[spring-boot-autoconfigure-3.3.0.jar:3.3.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1337) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1167) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:223) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:186) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:618) ~[spring-context-6.1.8.jar:6.1.8]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.0.jar:3.3.0]
at com.zjw.lease.AdminWebApplication.main(AdminWebApplication.java:17) ~[classes/:na]

为什么要去加载 tcnative-2.dll 库呢?

因为 Tomcat 中的 connector 为了提高性能,采用了加载与操作系统绑定(非跨平台)的本地库的方式,比如:Windows 系统中就是 .dll 动态链接库。

默认会去 Tomcat 的 bin 目录下去找,但是由于 Spring Boot 的 Tomcat 是嵌入式的,没有这些 .dll,所以需要自己去官网下载,并解压放到 C:\Windows\System32\ 目录下。

什么是 Tomcat Native?

Apache Tomcat Native Library 是与 Apache Tomcat 一起使用的可选组件,它允许 Tomcat 使用 Open SSL 作为 JSSE 的替代品来支持 TLS 连接。说白了,Tomcat Native 就是一套和操作系统紧密结合的库,不同类型的操作系统 Tomcat Native 就会不同,如:Windows 下就是动态链接库,Linux 系统就是 .so 库文件。使用 Tomcat Native 可以调用操作系统底层的能力,提升 Tomcat 的性能。

更多关于 Tomcat Native 的信息,请参考:https://tomcat.apache.org/native-doc/

下载 Tomcat Native

访问 https://archive.apache.org/dist/tomcat/tomcat-connectors/native/2.0.6/binaries/ 地址,下载 Tomcat Native,然后解压压缩包。将 tcnative-1.dll 和 openssl.exe 拷贝到 C:\Windows\System32\ 目录下。如下图:



原文:https://www.hxstrive.com/article/1201.htm

Spring Boot 不能加载 tcnative-2.dll 库(Can't load library: tcnative-2.dll)的更多相关文章

  1. spring boot启动加载项CommandLineRunner

    spring boot启动加载项CommandLineRunner 在使用SpringBoot构建项目时,我们通常有一些预先数据的加载.那么SpringBoot提供了一个简单的方式来实现–Comman ...

  2. 在Spring Boot中加载初始化数据

    文章目录 依赖条件 data.sql文件 schema.sql 文件 @sql注解 @SqlConfig 注解 在Spring Boot中加载初始化数据 在Spring Boot中,Spring Bo ...

  3. Spring boot 无法加载css样式,image解决办法

    Spring boot 无法加载css样式,image解决办法   最近在 给公司做一个系统,使用了springboot框架,同时也遇到了一些大坑 在网上找到了一个好看的模版的,(非前后端的分离)但是 ...

  4. Spring Boot 启动加载数据 CommandLineRunner

    实际应用中,我们会有在项目服务启动的时候就去加载一些数据或做一些事情这样的需求. 为了解决这样的问题,Spring Boot 为我们提供了一个方法,通过实现接口 CommandLineRunner 来 ...

  5. 十三、 Spring Boot 启动加载数据 CommandLineRunner

    实际应用中,我们会有在项目服务启动的时候就去加载一些数据或做一些事情这样的需求. 为了解决这样的问题,spring Boot 为我们提供了一个方法,通过实现接口 CommandLineRunner 来 ...

  6. Spring Boot 配置加载顺序详解

    使用 Spring Boot 会涉及到各种各样的配置,如开发.测试.线上就至少 3 套配置信息了.Spring Boot 可以轻松的帮助我们使用相同的代码就能使开发.测试.线上环境使用不同的配置. 在 ...

  7. Spring boot 配置文件 加载顺序

    springboot 启动会扫描以下位置的application.properties或者application.yml文件作为Spring boot的默认配置文件 –file:./config/ – ...

  8. spring boot启动加载数据

    实际应用中,我们会有在项目服务启动的时候就去加载一些数据或做一些事情这样的需求.为了解决这样的问题,spring Boot 为我们提供了一个方法,通过实现接口 CommandLineRunner 来实 ...

  9. spring boot容器加载完后执行特定操作

    有时候我们需要在spring boot容器启动并加载完后,开一些线程或者一些程序来干某些事情.这时候我们需要配置ContextRefreshedEvent事件来实现我们要做的事情 1.Applicat ...

  10. 23. Spring Boot启动加载数据CommandLineRunner【从零开始学Spring Boot】

    转:http://blog.csdn.net/linxingliang/article/details/52069503 实际应用中,我们会有在项目服务启动的时候就去加载一些数据或做一些事情这样的需求 ...

随机推荐

  1. Q:windows server2019由于没有远程桌面授权服务器可以提供许可证,远程回话连接已断开

    由于没有远程桌面授权服务器可以提供许可证,远程回话连接已断开,请跟服务管理员联系 原因是服务器安装了远程桌面服务RemoteApp,这个是需要授权的.但是微软官方给予了120天免授权使用,超过120天 ...

  2. redis的连接池和管道

    NoSQL泛指非关系型的数据库   非关系型数据库和关系型数据库的差别: 性能NOSQL是基于键值对的,可以想象成表中的主键和值的对应关系,而且不需要经过SQL层的解析,所以性能非常高 可扩展性同样也 ...

  3. Azure Data Factory - [01] 触发器

    题记部分 一.概述   Azure Data Factory(后面简称ADF)的触发器是一种机制,用于在特定事件发生时自动执行数据管道.触发器可以基于事件间隔.数据变化或其他外部事件来启动数据管道的执 ...

  4. sql 周岁计算

    select  FLOOR(DATEDIFF(DY, substring(身份证字段,7,4), GETDATE()) / 365.25)  age  from [表名]

  5. 震惊!Manus邀请码炒到5万元一个!附免费获取Manus邀请码两种方式

    在AI技术蓬勃发展的当下,一款名为Manus的产品掀起了行业巨浪.本文将深入剖析这款全球首款通用AI智能体,从它的惊艳亮相.独特功能,到其性能突破.模式限制,以及在AI领域的深远意义,全方位带大家了解 ...

  6. 一次客户演讲PPT 反思

    一 演讲ppt正常 制作流程: 编写演讲纲 与客户确认 确认通过后编写演讲稿 制作PPT 二 过程反思点 写纲前 与客户对接,了解需求及想法,最好音频记录 任务紧张程度.重要性想办法理清楚(领导跟踪情 ...

  7. python 二级 函数与代码复用

  8. python 将字典转换为列表

    在实现功能时,有时候有些函数适用于非字典形式 这时候就需要把字典转换为其他形式 本例主要讲解字典到列表转换 datas=[{'1':'nihao'},{'2':'very goog'}] to_lis ...

  9. 配置tmux默认shell使用fish

    设置tmux创建新窗口的时候的默认的shell类型 编写~/.tmux.conf文件 set-option -g default-shell /usr/bin/fish # 或者你想要的任何其他 sh ...

  10. nginx 部署vue http、https

    nignx配置文件 server { listen 80; server_name your_domain.com; return 301 https://$server_name$request_u ...