從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]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SecondServlet' did not find a matching property.  
 
bing之后,有人提到如下操作方法:

解決辦法:

1、在server控制台內,在服務器上點右鍵--屬性

2、general選項卡中點switch location

這時,location變為:/servers/tomcat6.0 server at localhost.server

3、在project explore中找到tomcat項目--Tomcat v6.0 Server at localhost.server  這個文件 ,雙擊打開

4、在最下面的server option里選中publis module context to separate xml file.保存。(保存時要先停止服務器)   
 
但是設置好之后發現還是存在該問題。
 
然后在stackoverflow上有人說了,這個根本不是問題,不用管。

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

Eclipse WTP adds a custom attribute source to the project related <Context> element in the server.xml of 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.xml will produce a warning during Tomcat's startup, even though there is no DTD nor XSD for server.xml.

Just ignore it. Your web project is fine. It should run fine. This issue is completely unrelated to JSF.  
 
最后發現確實這個問題可以不用管,我的站點無法訪問的問題是因為我的eclipse沒有設置為自動編譯,也就是代碼沒有編譯我就開始運行了,手動編譯一下之后就好了,傻x了吧
 
 




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM