日期:2014-05-20  浏览次数:21234 次

启动tomcat 加载framework的lib失败-20110622
整个应用采用的是 struts+spring+mybatis,在eclipse下开发,在tomcat6.0.32下面测试。
启动tomcat的时候,会自动加载struts,spring和batis的一些jar包。然后出现应用的首页。如果加载失败,就会出现404错误,因为无法根据配置找到要跳转的页面。

今天启动tomcat发现面板上只加载了一些tomcat的基本jar包,出现404错误。并发现这个异常信息:
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 。。。。。(系统的一些class path信息)

于是根据这个异常信息在baidu了一下,得到几条建议:

1) 从网上下载tcnative-1.dll文件, 加到tomcat/bin目录下。
2) tcnative-1.dll 文件版本不对,下载最新的。
3) 查看进程,强行关闭javaw.exe的进程,再启动。

我根据第三条建议,查看一下进程,发现有两个javaw.exe的进程在运行,平时看就只一个的,于是关闭着两个进程,再启动tomcat,发现一切正常了,所有关于framework里面jar包都加载成功。 但是那个错误:
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 。。。。。(系统的一些class path信息)
还是出现在在console中。 只是不影响程序使用了