Shell代码  

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

对于这个问题,网上很多人给出的原因和解决方案如下:

写道
出现SetPropertiesRule警告的原因是因为Tomcat在server.xml的Context节点中不支持source属性:<Context docBase="…" path="/…" source="org.eclipse.jst.j2ee.server:…"/>
解决方法是在Servers视图里双击创建的server,然后在其server的配置界面中选中"Publish module contexts to separate XML files"选项。

不过我按这种方式操作后发现还是会报这个问题,除了这种方式之外网上也没有什么参考资料了,这个问题纠结了我几天。仔细检查工程结构后发现我的工程根目录下生成了一个WebContent文件夹。具体截图如下:

一般来说正常的maven项目的web资源文件都是默认位于src/main/webapp下,WebContent只是普通的Dynamic Web project使用的默认Web文件目录。而我这个工程竟然同时生成了这两个目录,而且两个目录下都有WEB-INF文件夹。这个是不是问题的根源呢?

为了排查,我又重新新建了一个maven web project,工程名为test2。新建完后发现并没有生成WebContent文件夹。我们都知道,Eclipse中建Maven Web工程需要添加Project Facets。具体步骤如下图所示:

1.右键--Properties

2.选择Project Facets,然后点击右边的Convert to faceted from...

3.在弹出的窗口中选择Dynamic Web Module


4.如上图所示在窗口下方还有一个Further configuration available...,点击后弹窗如下,打开完后终于找到了原因所在,在这一步需要设置工程的content directory,如果不设置,目录名称默认就是WebContent。


前一步我是没有设置,所以才会生成默认的WebContent目录。

添加完Facets后,把test2工程部署在tomcat启动,发现之前的错误已经不存在了。

解决完问题后,心里还是有点不踏实,问题的根源到底是什么呢。逐一比对了两个工程的文件内容后终于发现了区别所在。区别在于工程.settings文件夹下。.settings目录下的文件附图如下:

上图高亮的部分的两个文件就是区别所在。

其中.jsdtscope中有一行定义:

  1. <classpathentry kind="src" path="WebContent"/>

而test2工程的定义如下:

  1. <classpathentry kind="src" path="src/main/webapp"/>

另外org.eclipse.wst.common.component文件中定义了工程的wb-resource

  1. <wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>

test2工程的定义如下:

  1. <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>

综上所述,推测tomcat在部署工程时会去查找.settings中定义的配置。如果配置有问题,则会报错。上面的问题,只要把xx工程.settings目录下对应的两个文件的配置修改后重新部署就能正常启动了。

Eclipse报错:Setting property 'source' to 'org.eclipse.jst.jee.server:xx' did not find a matching property的更多相关文章

  1. 从0开始学Java——eclipse下运行servlet程序警告:Setting property 'source' to 'org.eclipse.jst.jee.server:类名' did not find a matching property.

    在使用Eclipse 创建第一个 Servlet之后,并且配置好了tomcat,然后Run on server的之后,提示标题所示错误: 警告: [SetContextPropertiesRule]{ ...

  2. 配置servers时,错误:Setting property 'source' to 'org.eclipse.jst.jee.server:hczm' did not find a matching property

    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.e ...

  3. 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JsonBlog' did not find a matching property.

    这个问题困扰很久了,逛了很多论坛,终于得以解决 我的控制台错误如下: 五月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log ...

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

    警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclips ...

  5. 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:fhcq-oa' did not find a matching property.

    当你在使用Eclipse运行web项目时,你可能会看到控制台出现: 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Settin ...

  6. 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:esignmanage' did not find a matching property.解决

    1.开发环境: 环境:myeclipse2015+tomcat7+win10 2.异常: 偶尔在部署项目的时候回发现tomcat7部署后配置文件按照路径居然找不到自己的项目.httP://localh ...

  7. Tomcat_异常_01_Setting property 'source' to 'org.eclipse.jst.jee.server:AWeiXin_QiYe_Demo' did not find a matching property

    关于解决方法: 1.解决Setting property 'source' to 'org.eclipse.jst.jee.server的问题 2.eclipse中server location为灰色 ...

  8. 警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:20160928' did not find a matching property

    控制台看到如下警告: 症状原因: 在eclipse配置好的tomcat服务器上双击,打开tomcat服务器的配置界面.按如下操作配置服务器:在Server Options勾上的选项,会在你部署web项 ...

  9. Setting property 'source' to 'org.eclipse.jst.jee.server:web' did not find a matching property原因

    这个问题困扰了好久,虽然只是tomcat的一个警告,但强迫症让我总觉得不舒服,搜索了好多文章才找到知乎上一篇处理的最好的.另外:能找谷哥,尽量不要度娘,太浪费时间. 具体操作如下: 默认情况下,ser ...

随机推荐

  1. 调试 Android* x86 应用程序的方法以及要使用的工具

    作者:Xiaodong Wang 1.简单介绍 众所周知,Android* 开发者头顶很多称呼:设计员.程序员等,而且一般会不可避免地被称为故障检修工. 代码中的错误无法避免.因此不管您是否一開始就造 ...

  2. Cacti监控Redis实现过程

    Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监測图形分析工具.被广泛的用于对server的运维监控中,Cacti提供了一种插件式的管理.仅仅要按要求写好特定的模板,那 ...

  3. 9种样式CSS3 渐变button集

    <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/h ...

  4. [翻译角]Headline English: A Captain Should Be Pitch Perfect at a Multitude of Skills (ESLPOD Blog)

    以下转自www.eslpod.com,翻译为本人添加.其余版权均归原网站所有. ESLPOD是一个英语学习网站,我最初知道这个网站,是因为“奶爸”<把你的英语用起来>(电子版3元)一书的推 ...

  5. 蓝桥 PREV-30 历届试题 波动数列 【动态规划】

      历届试题 波动数列   时间限制:1.0s   内存限制:256.0MB      问题描述 观察这个数列: 1 3 0 2 -1 1 -2 ... 这个数列中后一项总是比前一项增加2或者减少3. ...

  6. Error:(2, 0) No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices. <

    compile报下面的错误Error:(2, 0) No service of type Factory available in ProjectScopeServices. 点击open file ...

  7. Keil和IAR——使用笔记

    1. 几个宏的定义 Keil和IAR均用到以下三种宏定义,分别是:USE_STDPERIPH_DRIVER——表示使用ST提供的标准外设固件库:STM32F40_41xxx——作为芯片的判断:VECT ...

  8. Applications using Launch Screen Files and targetting iOS 7.1 and earlier need to also include a Launch Image in an Asset Catalog.

    在使用xcode6建的项目时,有时在ios7模拟器下会出现一下情况 导航栏上方和tabbar下方会有黑边 并且会有一下警告: Applications using Launch Screen File ...

  9. 【USACO 2008FEB】 旅馆

    [题目链接] 点击打开链接 [算法] 线段树 对于一个节点,记录它从左端点延伸的最多的空房间的个数,从右端点延伸的最多的空房间个数,和该区间最多的连续 空房间个数 [代码] #include<b ...

  10. POJ 3734 Blocks 矩阵递推

    POJ3734 比较简单的递推题目,只需要记录当前两种颜色均为偶数, 只有一种颜色为偶数 两种颜色都为奇数 三个数量即可,递推方程相信大家可以导出. 最后来个快速幂加速即可. #include< ...