博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
eclipse 3.x中热部署WEB程序TOMCAT配置
阅读量:5859 次
发布时间:2019-06-19

本文共 6514 字,大约阅读时间需要 21 分钟。

Eclipse3.x中热部署项目,启动错误问题:

 

2009-4-14 22:12:33 org.apache.tomcat.util.digester.SetPropertiesRule begin

警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:t' did not find a matching property.
2009-4-14 22:12:33 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: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;.;F:\apache-tomcat-6.0.16\bin;F:\mysql\mysql-5.1.32-win32\bin;F:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Java\jdk1.6.0_02\bin;F:\SVNclient\TortoiseSVN\bin;C:\Program Files\StormII\Codec;C:\Program Files\StormII
2009-4-14 22:12:33 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8888
2009-4-14 22:12:33 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 729 ms
2009-4-14 22:12:33 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-4-14 22:12:33 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.16
2009-4-14 22:12:34 org.apache.catalina.core.StandardContext resourcesStart
严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base F:\myproject\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\t does not exist or is not a readable directory
    at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3957)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4126)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2009-4-14 22:12:34 org.apache.catalina.core.StandardContext start
严重: Error in resourceStart()
2009-4-14 22:12:34 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2009-4-14 22:12:34 org.apache.catalina.core.StandardContext start
严重: Context [/t] startup failed due to previous errors
2009-4-14 22:12:34 org.apache.catalina.core.StandardContext stop
信息: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/t] has not been started
2009-4-14 22:12:34 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8888
2009-4-14 22:12:34 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-4-14 22:12:34 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47  config=null
2009-4-14 22:12:34 org.apache.catalina.startup.Catalina start
信息: Server startup in 497 ms

 

产生问题是因为创建新的server和WEB项目后没有正确配置server服务,现正确配置如下

 

解决办法:

1.在servers中新建的SERVER上右击——属性的General项下右边Location属性点击SwitchLocation按钮,设置成/Servers/Tomcat v6.0 Server at localhost.server

(Server s : Properties -> General -> Location = /Servers/Tomcat v6.0 Server at localhost.server ;)

2.双击新建的server,修改Server Options设置:将Publish module contexts to separate XML files 打钩(最下面)

 

3. 配置WEB项目的server选项:右击WEB项目——属性(properties)——server(新建WEB项目后默认是none)选中里面您servers热部署中创建的server(我的是Tomcat v6.0 Server at localhost.server )。

 

搜索到的相关解释:

(

 

Explaination :

  • Tomcat of previous version doesn' t support the "source" attribute in the "Context" node of "server .xml" file.

Result :

  • A separate XML file named "demo.xml" was created in the "$server path$\conf\Catalina\localhost\".

)

 

  注意:【metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\t does not exist or is not a readable directory 】该问题是WEB项目作了不恰当的重命名相关文件夹,或则误删除某些目录又重新创建后导致eclipse无法在使用热部署时候自动同步相关配置。

此时:可手动部署方式将固定的WEB部署目录结构创建到metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\目录底下。如:mytest项目 可以创建结构如下:创建mytest目录,在mytest文件夹目录中创建META-INF、WEB-INF两个文件夹目录。配置到这,此两个文件夹目录底下应该放些什么内容,大家应该都清楚了。正常项目tomcat中结构。如果是新建项目啥都还没写的话建议删除重新创建一个WEB项目,此时ECLIPSE会自动感应。

 

 

到此配置完毕,重新启动吧。应该没问题了。

启动正确输出信息:

2009-4-14 22:35:40 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: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;.;F:\apache-tomcat-6.0.16\bin;F:\mysql\mysql-5.1.32-win32\bin;F:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Java\jdk1.6.0_02\bin;F:\SVNclient\TortoiseSVN\bin;C:\Program Files\StormII\Codec;C:\Program Files\StormII
2009-4-14 22:35:40 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8888
2009-4-14 22:35:40 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 594 ms
2009-4-14 22:35:40 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-4-14 22:35:40 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.16
2009-4-14 22:35:40 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8888
2009-4-14 22:35:40 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-4-14 22:35:40 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31  config=null
2009-4-14 22:35:40 org.apache.catalina.startup.Catalina start

信息: Server startup in 439 ms

转载于:https://www.cnblogs.com/zengsong-restService/archive/2013/01/04/2844544.html

你可能感兴趣的文章
1月20日ECS升级通知
查看>>
Material Design学习之 Button(详细分析,传说中的水滴动画)
查看>>
适配器模式
查看>>
反射封装request参数为对象
查看>>
Shell基础之-grep命令
查看>>
PostgreSQL backup and recovery - online logical backup & recovery
查看>>
C++玫瑰
查看>>
如何在Element UI 对话框里面加载高德地图
查看>>
深入理解编译注解(三)依赖关系 apt/annotationProcessor与Provided的区别
查看>>
类似微信首页弹性滚动和惯性滚动效果的实现——OverScroll
查看>>
试读angular源码第一章:开场与platformBrowserDynamic
查看>>
android插件自定义之多渠道打包插件(支持微信资源混淆andResGuard)
查看>>
Win实用好用软件清单推荐
查看>>
一道关于面向对象面试题
查看>>
程序员的商业模式
查看>>
Vue双向绑定实现
查看>>
阿里数据库内核月报:2017年06月
查看>>
使用html5做的环形进度条
查看>>
如何写一份更好的简历
查看>>
web端播放m3u8视频流注意事项
查看>>