码迷,mamicode.com
首页 > Web开发 > 详细

tomcat警告:Setting property 'source' to 'org.eclipse.jst.j2ee.server:ServletPro' did not find a matching property

时间:2015-10-20 11:42:21      阅读:406      评论:0      收藏:0      [点我收藏+]

标签:

警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclipse.jst.j2ee.server:ServletPro‘ did not find a matching property.

原因:这是因为我们在eclipse下,通过tomcat部署web工程时,tomcat的配置文件server.xml中会自动生成一个关于该web工程的配置信息,类似于下面的东西:

技术分享

而server.xml的 Context元素不支持名称为source的属性,所以会发出警告

 

解决方案一:

关闭tomcat,双击eclipse下tomcat服务器,在出来的Tomcat server at localhost页面中找到server options选项,选中其中的选项"Publish modual contexts to separat XML file",保存后重启tomcat,这样重新发布web项目时,就不会将Context添加到server.xml文件中,而是在$CATALINA_BASE/conf/[enginename]/[hostname]/下生成一个[webappname].xml的文件,如下:

技术分享

ServletPro.xml中的内容如下:

技术分享

但其实这样启动tomcat后还是会警告,因为tomcat启动时会读取$CATALINA_BASE/conf/[enginename]/[hostname]/下的所有.xml文件(这一点可以参看我的另一篇博客:tomcat启动以及运行时部署应用),结果依旧发现Context元素不支持source属性,因此依旧警告

 

解决方案二:

http://stackoverflow.com/questions/3566146/setting-property-source-to-org-eclipse-jst-jee-serverjsftut-did-not-find-a

This is not an error. This is a warning. The difference is pretty huge. This particular warning basically means that the <Context> element in Tomcat‘s server.xml contains an unknown attribute source and that Tomcat doesn‘t know what to do with this attribute and therefore will ignore it.

Eclipse WTP adds a custom attribute source to the project related <Context> element in the server.xml of Tomcat which identifies the source of the context (the actual project in the workspace which is deployed to the particular server). This way Eclipse can correlate the deployed webapplication with an project in the workspace. Since Tomcat version 6.0.16, any unspecified XML tags and attributes in the server.xml will produce a warning during Tomcat‘s startup, even though there is no DTD nor XSD for server.xml.

Just ignore it. Your web project is fine. It should run fine. This issue is completely unrelated to JSF.

大意其实和上面的差不多,也是Context不支持source属性,这个source属性是Eclipse WTP自定义的一个属性,用来绑定发布的web项目和在workspace中的工程,你可以忽略这个警告,因为它对我们的web项目毫无影响。

 

tomcat警告:Setting property 'source' to 'org.eclipse.jst.j2ee.server:ServletPro' did not find a matching property

标签:

原文地址:http://www.cnblogs.com/kevinq/p/4894080.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!