奏流水以何惭 2011-07-12 14:03
浏览 266
已采纳

Tomcat7 Eclipse3.7 添加Dynamic Web Project后启动服务器有警告

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

怎么解决啊?求教~~ 
问题补充
自己安慰一下自己,求帮助~

  • 写回答

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]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常