RT,警告如下:
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2HelloWorld' did not find a matching property.
按照网上搜索了下,Tomcat6也有这个问题,但是Tomcat6中可以解决这个问题:在Eclipse里面停止服务器,双击服务器名称,在服务器配置页面中选中Publish module contexts to separate XML files选项就能解决,我新建一个Tomcat6的服务器也的确如此,但是在Tomcat7下面还是有问题。依旧警告:
信息: Deploying configuration descriptor Struts2HelloWorld.xml from D:\Trouble\Workspace\J2EE.metadata.plugins\org.eclipse.wst.server.core\tmp3\conf\Catalina\localhost
2011-7-12 11:22:46 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2HelloWorld' did not find a matching property.
2011-7-12 11:22:46 org.apache.coyote.AbstractProtocolHandler start
怎么解决啊?求教~~
问题补充
自己安慰一下自己,求帮助~
Tomcat7 Eclipse3.7 添加Dynamic Web Project后启动服务器有警告
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
5条回答 默认 最新
- 「已注销」 2011-07-12 16:32关注
从官方下载的tomcat,6、7都用过,使用[b]conf/Catalina/localhost/xxx.xml方式进行开发和发布应用[/b]还没有发生施主这样的问题。
标准xxx.xml发布样例,[url=http://tomcat.apache.org/tomcat-7.0-doc/config/context.html]官方配置参考[/url]:
[code="xml"]
<?xml version="1.0" encoding="UTF-8" ?>
[/code]- 现象: [quote] 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts2HelloWorld' did not find a matching property. [/quote]
-
分析:
a. SetContextPropertiesRule源代码:
[code="java"]
@Override
public void begin(String namespace, String nameX, Attributes attributes)
throws Exception {for (int i = 0; i < attributes.getLength(); i++) { String name = attributes.getLocalName(i); if ("".equals(name)) { name = attributes.getQName(i); } if ("path".equals(name) || "docBase".equals(name)) { continue; } String value = attributes.getValue(i); if (!digester.isFakeAttribute(digester.peek(), name) && !IntrospectionUtils.setProperty(digester.peek(), name, value) && digester.getRulesValidation()) { digester.getLogger().warn("[SetContextPropertiesRule]{" + digester.getMatch() + "} Setting property '" + name + "' to '" + value + "' did not find a matching property."); } }
}
[/code]
b. 实际上查看[url=http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Attributes]Context配置参考[/url],在xml节点"Context"中并不存在source这样的属性(attributes),所以就会出来一个warn警告信息。
[b]以上没有仔细研究tomcat源代码,不是100%确信就是这样的原因。[/b]
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥100 c语言,请帮蒟蒻看一个题
- ¥15 名为“Product”的列已属于此 DataTable
- ¥15 安卓adb backup备份应用数据失败
- ¥15 eclipse运行项目时遇到的问题
- ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
- ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
- ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
- ¥50 成都蓉城足球俱乐部小程序抢票
- ¥15 yolov7训练自己的数据集
- ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)