Java 将属性 'source' 设置为 'org.eclipse.jst.jee.server:JSFTut' 没有找到匹配的属性

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3566146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:54:52  来源:igfitidea点击:

Setting property 'source' to 'org.eclipse.jst.jee.server:JSFTut' did not find a matching property

javaeclipsetomcat

提问by Jitendra

I am getting following error, when I run the demo JSF application on the console

当我在控制台上运行演示 JSF 应用程序时出现以下错误

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

采纳答案by BalusC

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.xmlcontains an unknown attribute sourceand that Tomcat doesn't know what to do with this attribute and therefore will ignore it.

这不是错误。这是一个警告。差异相当大。这个特别的警告基本上意味着<Context>Tomcat 中的元素server.xml包含一个未知属性source,Tomcat 不知道如何处理这个属性,因此将忽略它​​。

Eclipse WTP adds a custom attribute sourceto the project related <Context>element in the server.xmlof 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.xmlwill produce a warning during Tomcat's startup, even though there is no DTD nor XSDfor server.xml.

Eclipse WTPsource向Tomcat 中的项目相关<Context>元素添加了一个自定义属性,server.xml用于标识上下文的源(工作区中部署到特定服务器的实际项目)。通过这种方式,Eclipse 可以将部署的 Web 应用程序与工作区中的项目相关联。由于Tomcat的版本6.0.16,在任何未指定的XML标记和属性server.xml会产生Tomcat的启动时警告,即使有没有DTD也不XSDserver.xml

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

只是忽略它。你的网络项目很好。它应该运行良好。这个问题与JSF完全无关。

回答by arvindwill

Remove the project from the server from the Server View. Then run the project under the same server.

从服务器视图中从服务器中删除项目。然后在同一台服务器下运行项目。

The problem is as @BalusC told corrupt of server.xml of tomcat which is configured in the eclipse. So when you do the above process server.xml will be recreated .

问题是@BalusC告诉eclipse中配置的tomcat的server.xml损坏了。所以当你做上面的过程 server.xml 将被重新创建。

回答by Marcus

I thought I'd add that for Tomcat 7.x, <Context>is not in the server.xml, but in the context.xml. Removing and re-adding the project did not seem to help my similar issue, which was a web.xml issue, which I found out by checking the context.xmlwhich had this line in the <Context>section:

我想我应该补充的是,Tomcat的7.x的,<Context>是不是在server.xml,但在context.xml。删除并重新添加项目似乎对我的类似问题没有帮助,这是一个 web.xml 问题,我通过检查该context.xml部分中有这一行的<Context>内容发现:

<WatchedResource>WEB-INF/web.xml</WatchedResource>

<WatchedResource>WEB-INF/web.xml</WatchedResource>

The solution in WARNING: Setting property 'source' to 'org.eclipse.jst.jee.server:appname' did not find a matching propertybrought me closer to my answer, as the change of publishing into a separate XML did resolve the error reported above for me, but unfortunately it generated a second error that I'm still investigating.

WARNING: Setting property 'source' to 'org.eclipse.jst.jee.server:appname' 中的解决方案没有找到匹配的属性让我更接近我的答案,因为将发布更改为单独的 XML 确实解决了错误上面为我报告,但不幸的是它产生了我仍在调查的第二个错误。

WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:myproject' did not find a matching property.

WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:myproject' did not find a matching property.

回答by Greg Knox

In regards to setting the logging.properties value

关于设置 logging.properties 值

org.apache.tomcat.util.digester.Digester.level = SEVERE

org.apache.tomcat.util.digester.Digester.level = SEVERE

... if you're running an embedded tomcat server in eclipse, the logging.propertiesfile used by default is the JDK default at %JAVA_HOME%/jre/lib/logging.properties

...如果您在 Eclipse 中运行嵌入式 tomcat 服务器,则logging.properties默认使用的文件是 JDK 默认的%JAVA_HOME%/jre/lib/logging.properties

If you want to use a different logging.properties file (e.g. in the tomcat server's confdirectory), this needs to be set via the java.util.logging.config.filesystem property. e.g. to use the logging properties defined in the file c:\java\apache-tomcat-7.0.54\conf\eclipse-logging.properties, add this to the VM argument list:

如果您想使用不同的 logging.properties 文件(例如在 tomcat 服务器的conf目录中),则需要通过java.util.logging.config.file系统属性进行设置。例如,要使用文件中定义的日志属性c:\java\apache-tomcat-7.0.54\conf\eclipse-logging.properties,请将其添加到 VM 参数列表中:

-Djava.util.logging.config.file="c:\java\apache-tomcat-7.0.54\conf\eclipse-logging.properties"

-Djava.util.logging.config.file="c:\java\apache-tomcat-7.0.54\conf\eclipse-logging.properties"

(double-click on the server icon, click 'Open launch configuration', select the Arguments tab, then enter this in the 'VM arguments' text box)

(双击服务器图标,单击“打开启动配置”,选择“参数”选项卡,然后在“VM 参数”文本框中输入此内容)

You might also find it useful to add the VM argument

您可能还会发现添加 VM 参数很有用

-Djava.util.logging.SimpleFormatter.format="%1$tc %4$s %3$s %5$s%n"

-Djava.util.logging.SimpleFormatter.format="%1$tc %4$s %3$s %5$s%n"

as well, which will then include the source logger name in the output, which should make it easier to determine which logger to throttle in the logging.properties file (as per http://docs.oracle.com/javase/7/docs/api/java/util/logging/SimpleFormatter.html)

同样,它将在输出中包含源记录器名称,这应该更容易确定在 logging.properties 文件中限制哪个记录器(根据http://docs.oracle.com/javase/7/docs /api/java/util/logging/SimpleFormatter.html)

回答by Siva Kameswara Rao Munipalle

I have faced the similar issue. Steps to resolve this.

我遇到过类似的问题。解决此问题的步骤。

  1. Remove the project from server
  2. Give clean and build for the entire project
  3. Delete the server
  4. Use Run as to deploy and run the project
  1. 从服务器中删除项目
  2. 为整个项目进行清理和构建
  3. 删除服务器
  4. 使用 Run as 部署和运行项目

Hope this works for you too.

希望这对你也有用。

回答by Issac Balaji

Please check if any jar files missing particularly jars are may have been taken as locally, so put into lib folder then create the WAR file

请检查是否有缺少的 jar 文件,特别是 jar 可能是本地取的,所以放入 lib 文件夹然后创建 WAR 文件

回答by mdfst13

Update to the latest release

更新到最新版本

Since this commit, this is is fixed in the development version of Tomcat. And now in released versions 9.0.13, 8.5.35, and 7.0.92.

由于此提交,此问题已在 Tomcat 的开发版本中修复。现在已发布版本 9.0.13、8.5.35 和 7.0.92。

From the 9.0.13 changelog:

从 9.0.13 更新日志

Ignore an attribute named source on Context elements provided by StandardContext. This is to suppress warnings generated by the Eclipse / Tomcat integration provided by Eclipse. Based on a patch by mdfst13. (markt)

忽略 StandardContext 提供的 Context 元素上名为 source 的属性。这是为了抑制由 Eclipse 提供的 Eclipse / Tomcat 集成生成的警告。基于 mdfst13 的补丁。(市场)

There are similar entries in the 7.0.92and 8.5.35changelogs.

7.0.928.5.35 更新日志中有类似的条目。

The effect of this change is to suppress a warning when a sourceattribute is declared on a Contextelement in either server.xml or a context.xml. Since those are the two places that Eclipse puts such an attribute, that fixes this particular issue.

此更改的效果是在 server.xml 或 context.xml 中sourceContext元素上声明属性时抑制警告。由于这是 Eclipse 放置此类属性的两个地方,因此可以解决此特定问题。

TL;DR: update to the latest Tomcat version in its branch, e.g. 9.0.13 or newer.

TL;DR:更新到其分支中的最新 Tomcat 版本,例如 9.0.13 或更高版本。

回答by MangduYogii

This is simple solution for this warning:

这是此警告的简单解决方案:

You can change the eclipse tomcat server configuration. Open the server view, double click on you server to open server configuration. There is a server OptionTab. inside that tab click check Box to activate "Publish module contents to separate XML files".

您可以更改 eclipse tomcat 服务器配置。打开服务器视图,双击您的服务器打开服务器配置。有一个服务器选项选项卡。在该选项卡内单击复选框以激活“将模块内容发布到单独的 XML 文件”。

Finally, restart your server, the message must disappear.

最后,重新启动您的服务器,该消息必须消失。