Java 将属性 'source' 设置为 'org.eclipse.jst.jee.server:GestorContenidoWS' 未找到匹配的属性。尝试所有解决方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16416420/
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
Setting property 'source' to 'org.eclipse.jst.jee.server:GestorContenidoWS' did not find a matching property. Try all the solutions
提问by Bender
This is my first post here (but not the first time that I visit the page, I found a lot of solutions here), first of all, sorry for my english I will try to explain myself as best I can.
这是我在这里的第一篇文章(但不是我第一次访问该页面,我在这里找到了很多解决方案),首先,对不起我的英语,我会尽力解释自己。
This question appears another time in this page, but I tried all the solutions that the people post and I still with this problem, well here we go.
这个问题又出现在这个页面上,但我尝试了人们发布的所有解决方案,但我仍然遇到这个问题,我们开始吧。
I made a project on Eclipse(indigo) for launch like a WebService (I did it before with succes, is not my first time) and when I Run on Server(Tomcat7) all seems fine and the appears this Warning.
我在 Eclipse(indigo) 上做了一个像 WebService 一样启动的项目(我以前成功地做过,这不是我第一次),当我在服务器(Tomcat7)上运行时,一切似乎都很好,出现了这个警告。
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:GestorContenidoWS' did not find a matching property.
Then appear in the Web perspective of Eclipse the page "HTTP 404". I'm telling this because I read in other post that this Warning is not a problem, but seems that it is for me (The project is also vinculated with a JPA Persistence).
然后在 Eclipse 的 Web 透视图中出现页面“HTTP 404”。我之所以这么说是因为我在其他帖子中读到这个警告不是问题,但似乎对我来说是这样(该项目还带有 JPA 持久性)。
.I found two solutions for make dissappear this Warning. First, go to Server Overview and select the option 'Publish module contexts to separate XML files' and then try to Run on server again, but didn't work.
.我找到了两种使这个警告消失的解决方案。首先,转到服务器概览并选择“发布模块上下文以分隔 XML 文件”选项,然后再次尝试在服务器上运行,但没有成功。
The other option was, remove the project from the server from the Server View. Then run the project under the same server for recreated server.xml, but didn't work also.
另一个选项是,从服务器视图中从服务器中删除项目。然后在同一服务器下运行该项目以重新创建 server.xml,但也不起作用。
Anybody can help me? Maybe the problem of this "HTTP 404 requested resource (/GestorContenidoWS/) is not available." is in another part or its because this Warning?"
任何人都可以帮助我吗?也许是这个“HTTP 404 请求的资源(/GestorContenidoWS/)不可用”的问题。是在另一部分还是因为这个警告?”
The code of my server.xml (without comments) is this:
我的 server.xml(不带注释)的代码是这样的:
<?xml version="1.0" encoding="UTF-8"?>
--><Server port="8005" shutdown="SHUTDOWN">
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1"redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="GestorContenidoWS" path="/GestorContenidoWS" reloadable="true" source="org.eclipse.jst.jee.server:GestorContenidoWS"/></Host>
</Engine>
</Service>
Thank you
谢谢
回答by Gautam
This is a warning and can be safely ignored. Tomcat or the Web container does not understand what to do with the property set by Eclipse
这是一个警告,可以安全地忽略。Tomcat 或 Web 容器不明白 Eclipse 设置的属性如何处理
回答by hKs
First of all this is a warning and not an error. So there is no need to worry too much about it. Basically it means, that Tomcat does not know what to do with the source attribute from context.
首先,这是警告而不是错误。所以没有必要太担心它。基本上这意味着,Tomcat 不知道如何处理上下文中的源属性。
This source attribute is set by Eclipse (or to be more specific the Eclipse Web Tools Platform) to the server.xml file of Tomcat to match the running application to a project in workspace.
此源属性由 Eclipse(或者更具体地说是 Eclipse Web 工具平台)设置到 Tomcat 的 server.xml 文件,以将运行的应用程序与工作区中的项目相匹配。
Tomcat generates a warning for every unknown markup in the server.xml (i.e. the source attribute) and this is the source of the warning. You can safely ignore it.
Tomcat 为 server.xml 中的每个未知标记(即源属性)生成警告,这就是警告的来源。您可以放心地忽略它。
回答by Ahmad R. Nazemi
set contex-root
设置上下文根
<property name="context-root" value="path" />
and http://localhost:8080/pathshow your index file
和http://localhost:8080/path显示您的索引文件
回答by Bar?? ?zdemir
Find server.xml. For example "C:\Dev\apache-tomcat-8.5.23\conf\server.xml"
找到 server.xml。例如“C:\Dev\apache-tomcat-8.5.23\conf\server.xml”
Find your application in server.xml
在 server.xml 中找到您的应用程序
<Context docBase="C:\Dev\apache-tomcat-8.5.23\wtpwebapps\SpringRestExample" path="/spring" reloadable="true" source="org.eclipse.jst.jee.server:SpringRestExample"/></Host>
Expected url http://localhost:8080/SpringRestExample/rest/emp/9999
预期网址http://localhost:8080/SpringRestExample/rest/emp/9999
But (path="/spring") instead (path="/SpringRestExample")
但是 (path="/spring") 而不是 (path="/SpringRestExample")
Therefore current url http://localhost:8080/spring/rest/emp/9999