tomcat中服务启动时输出D:\LSoft\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin

今天早上启动项目时控制台输出下面信息(tomcat是tomcat6.0),之前项目没有出现这样的问题.

2013-5-11 11:34:31 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\LSoft\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\LSoft\MyEclipse\apache-tomcat-6.0\bin
2013-5-11 11:34:31 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2013-5-11 11:34:31 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 223 ms
2013-5-11 11:34:31 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2013-5-11 11:34:31 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.29
2013-5-11 11:34:31 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2013-5-11 11:34:31 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2013-5-11 11:34:31 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2013-5-11 11:34:31 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory Test
2013-5-11 11:34:31 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2013-5-11 11:34:31 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2013-5-11 11:34:31 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/10  config=null
2013-5-11 11:34:31 org.apache.catalina.startup.Catalina start
信息: Server startup in 391 ms

 

访问项目时页面出现

项目中有上传下载的功能,所以在tomcat server.xml添加了
<Context path="/sll103111040" reloadable="true" docBase="D:\LSoft\MyEclipse\Workspaces\MyEclipse 10\sll103111040\WebRoot" workDir="D:\LSoft\MyEclipse\Workspaces\MyEclipse 10\sll103111040\WebRoot\upload" />
设置虚拟路径,不知道是不是和这个有关系
 
当使用myeclipse中自带tomcat时输出(tomcat中的server.xml)没修改
 
2013-5-11 13:40:07 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\LSoft\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\LSoft\MyEclipse\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201109141806\tomcat\bin
2013-5-11 13:40:07 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2013-5-11 13:40:07 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 212 ms
2013-5-11 13:40:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2013-5-11 13:40:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.13
2013-5-11 13:40:07 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\LSoft\MyEclipse\Workspaces\MyEclipse 10\.metadata\.me_tcat\webapps\sll103111040\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2013-5-11 13:40:08 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2013-5-11 13:40:08 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2013-5-11 13:40:08 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/11  config=null
2013-5-11 13:40:08 org.apache.catalina.startup.Catalina start
信息: Server startup in 367 ms
定时器:1368250814159
outUpload
ok
程序可以运行。

这个问题和我以前设置虚拟路径没关系的。
问题是The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
引用信息:Loaded APR based Apache Tomcat Native library 1.1.17
解决方法:
Myeclipse 10中的tomcat 需要apr是1.1.17版本的 tcnative-1.dll
一.找到apr目录:
D:\LSoft\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;(在这调语句后The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path)

二.下载1.1.17版本的apr 
下载地址:( tcnative-1.dll 1.1.17版本)
http://download.csdn.net/download/angry_carnival/5343202
三.重启tomcat就可以了
运行成功会看到这条语句
Loaded Apache Tomcat Native library 1.1.17.
apr详解:(熟悉apr)
http://blog.chenlb.com/2009/01/install-apache-portable-runtime-or-tomcat-native-on-tomcat.html
tomcat 6.0也需要找到apr的目录:
D:\LSoft\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;
tomcat 6.0x需要apr版本是tcnative-1.dll 1.1.19版本
apr下载地址:(使用1.1.20版本就可以了)
http://download.csdn.net/download/angry_carnival/5343202

tomcat 6.0.10 APR 配置指南
连接地址:
http://hi.baidu.com/lucene1853/item/2fdadb17e4498a27f7625c78 

ubuntu10.04手动安装jdk1.6.0_24配置 
连接地址:
http://www.cnblogs.com/Jackeyzhang/archive/2011/05/18/2049755.html

如果安装了apr技术,可以看到以下结果:
信息: Loaded APR based Apache Tomcat Native library 1.1.14.2009-1-13 11:12:51 org.apache.catalina.core.AprLifecycleListener init信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 使用APR提高Tomcat性能Tomcat可以使用APR来提供超强的可伸缩性和性能,更好地集成本地服务器技术.
但是项目文件访问时出错是和我修改了tomcat中conf下server.xml有关。因为修改server.xml原因当访问项目文件时错误信息是不显示的。
解决方法:
1.将server.xml修改的部分剪切掉,保存server.xml.重启tomcat错误信息会显示。先看tomcat启动是否正常。让后再访问项目文件。我的tomcat启动正常,项目文件访问报404

2.这时你根据控制台输出寻找错误。我的错误是
D:\LSoft\MyEclipse\apache-tomcat-6.0\webapps\BS\WEB-INF\lib
原因:
\WEB-INF\lib\ 下已经存在这个jar包
解决方法:
将WEB-INF/lib下的 servlet-api.jar 删掉吧! tomcat自己有,不需要你提供! 
顺便看看其他的jar, 和 tomcat\lib 目录比较一下,tomcat已经有的,就别留着了!
tomcat 启动后先将tomcat/common/lib目录下的jar包全部读入内存,如果webapps目录里的应用程序中WEB-INF/lib目录下有相同的包,将无法加载,估计不同版本的包之间也会造成类似问题。因此建议尽量不要把jar包放入tomcat/common/lib目录下,应该放入WEB- INF/lib目录下。

纠结了两天。今天早上将server.xml恢复后发现了问题。其实以前遇到过一次这个问题。是别人帮忙修改的也没太在意。而且有很长一段时间用domino。现在是重拾tomcat,之前记录问题都是喜欢拿别人解决问题的方法修改变成自己笔记的。突然发现问题很严重,毕竟自己通过整理思路和寻求bug解决方案印象会很深刻的。所以还是自己动手做做笔记写写博客会很好的。有不懂的可以去参考前辈的方案

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值