- UnsatisfiedLinkError: no xxx in java.library.path
在启动程序时,或者运行过程中输出:
“UnsatisfiedLinkError: no xxx in java.library.path”
定位方法:
“java.library.path”是 Java 用来寻找 JNI(Native)库的路径(.dll,.so等);
输入该异常一般是因为找不到对应运行时版本的dll或者so文件;
(没有该文件,或者“java.library.path”设置不正确)
问题解决:
2.UnsatisfiedLinkError: Can’t load IA 32-bit .dll on 64-bit
问题描述:
- 看看“java.library.path”中是否有该 dll/so 文件;
- 在代码中可通过 System.getProperty(..) 来输出该路径,可以通过System.setProperty(..) 来设置该路径;
- 在Eclipse中调试时,可以在项目右键->属性->Java Buld Path ->Libraries -> 对应的jar包 -> Native library location -> Edit 来设置)
在启动程序时,或者运行过程中输出:
“UnsatisfiedLinkError: /path/to/xxx.dll Can't load IA 32-bit .dll on a AMD 64-bit platform”
定位方法:这个是因为使用的dll/so JNI动态库文件与当前虚拟机(32/64位)版本不匹配。
问题解决:
在Eclipse中调试时,可以在项目右键->属性->Java Buld Path ->Libraries -> JRE System Library -> Edit 中选择32位版本的JDK。
3.Unable to add the resource at [xxx] to the cache
- 看看对应的dll/so文件与当前的JVM运行时是否匹配(32/64位);
- 可以尝试更换与当前JVM向匹配的dll/so;或者更换32/64位的JVM;
问题描述:
在tomcat 启动/运行时出现:
警告: Unable to add the resource at [/WEB-INF/lib/xmlgraphics-commons-1.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
五月 09, 2018 5:33:32 下午 org.apache.catalina.webresources.Cache getResource
警告: Unable to add the resource at [/WEB-INF/lib/woodstox-core-asl-4.2.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
五月 09, 2018 5:33:32 下午 org.apache.catalina.webresources.Cache getResource
警告: Unable to add the resource at [/WEB-INF/lib/thumbnailator-0.4.8.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
五月 09, 2018 5:33:32 下午 org.apache.catalina.webresources.Cache getResource
警告: Unable to add the resource at [/WEB-INF/lib/spring-aop-3.2.10.RELEASE.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
五月 09, 2018 5:33:32 下午 org.apache.catalina.webresources.Cache getResource
警告: Unable to add the resource at [/WEB-INF/lib/spring-jdbc-3.1.1.RELEASE.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
五月 09, 2018 5:33:32 下午 org.apache.catalina.webresources.Cache getResource
定位方法:
在 tomcat 8+ 增加了资源缓存机制,上面的告警信息是因为缓存空间设置不足导致;
参考:
http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html
问题解决:
修改配置文件 {tomcat}/conf/context.xml 增加资源缓存的大小。
注:需要消耗更多的内存空间;