eclipse juno布署动态web项目到tomcat

 

布署动态web项目到tomcat

eclipse juno中把项目布署到tomcat 并不是像myeclipse把项目内容发布到tomcatwebapps目录下,而在配制了一个虚拟的目录.所以比myeclipse布署项目要快,而且,package视图中可以直接查看虚拟目录中的内容.



 Publish module contexts to separate XML files

关于解决方法,再详细说明一下:

 

Servers视图的打开方法:Window--Show Vie

 

w-other..--Servers

双击Server:就是双击服务器名,我的服务器名为:Tomcat v6.0 Server at localhost 即双击它,进入server的配置界面: 选中"Publish module contexts to separate XML files"选项

如果不勾选这个选项会出现下面这个警告信息:

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:mybabasport' did not find a matching property.

 

出现上面那个警告信息的原因是:

在网上查了一下,很多人也碰到这个问题

转一下别人的解释:有的说将Tomcat的版本换成6.0.14就可以了;还有的说在建立Dynamic Web Project时把"Dynamic Web Module"选项后面的版本号由2.5改成2.4也行。不过这些回答好像都不能真正地解决问题。
出现SetPropertiesRule警告的原因是因为Tomcatserver.xmlContext节点中不支持source属性:<Context docBase="…" path="/…" source="org.eclipse.jst.j2ee.server:…"/>

解决方法是在Servers视图里双击创建的server,然后在其server的配置界面中选中"Publish module contexts to separate XML files"选项。


具体“Publish module contexts to separate XML files”是什么意思,

请看Tomcat Publishing Options介绍:


Two new options which affect publishing are now available in the Server Options section of the Tomcat server editor. The Tomcat server must be 5.0.x or later for these options to be enabled. The Serve modules without publishing option does what it says. Web content will be served directly from the "WebContent" folder of the Dynamic Web Project. A customized context is used to make the project's dependencies available in the Web application's classloader. The Publish module contexts to separate XML files option will publish contexts using the preferred method of separate XML files under the "conf/Catalina/localhost" directory, rather than keeping them in the "server.xml" file. A couple of improvements for this option are noted in Bugs 180931 and 180936.

猜你喜欢

转载自olikeit.iteye.com/blog/1837116