警告:[SetPropertiesRule]Setting property 'source' to xxx did not find a matching property.的消除

啓動JSP頁面時報錯,全文如下:

九月 25, 2016 7:47:39 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:(工程名)' did not find a matching property.

報錯原因:

默認情況下,Tomcat在server.xml的Context節點不支持名稱爲source的屬性,就出現該警告。

解決辦法:

在服務器配置頁選擇在servers視圖下雙擊當前服務器,彈出配置頁面:


Servers設置頁面截圖

相關解釋:(出處待定)

Tomcat Publishing Options
Two new options which affect publishing are now available in the Server Options section of the Tomcat server editor. The Tomcat server must be 5.0.x or later for these options to be enabled. The Serve modules without publishing option does what it says. Web content will be served directly from the "WebContent" folder of the Dynamic Web Project. A customized context is used to make the project's dependencies available in the Web application's classloader. 
The Publish module contexts to separate XML files option will publish contexts using the preferred method of separate XML files under the "conf/Catalina/localhost" directory, rather than keeping them in the "server.xml" file. A couple of improvements for this option are noted in Bugs 180931 and 180936.

字面意思大致爲:

Tomcat發佈選項

  Tomcat服務器編輯器中的【服務器選項】部分目前新增了兩個影響發佈環節的選項。啓用這兩個選項,要求Tomcat服務器版本在5.0.x以上。【The Serve modules without publishing】選項實現的功能如其名稱所述,網頁內容將直接從動態網頁項目(Dynamic Web Project)的“WebContent”(網頁內容)文件夾中獲取。爲確保Web應用程序的類加載器在工程項目的依賴項中可用,需要用到一個自定義的開發環境(context)。

  【The Publish module contexts to separate XML files】選項將優先採用分離“conf/Catalina/localhost”目錄下XML文件的方式發佈開發環境,不會令其保存在server.xml文件中。關於該選項的一些改進措施詳見Bugs 180931與180936。

  原文不是很懂,查網上的說法,大概意思是勾選第一個選項後,讓tomcat直接使用WebContent下的內容,無需發佈到設置前的路徑下:<workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps。其他改動:①會將tmp0\wtpwebapps目錄下相關的resources刪除;②會修改Servers/Tomcat v8.0 Server at localhost-config/servers.xml中的serveModulesWithoutPublish屬性,值被設置爲true。

  至於勾選第二項,也就是本文需要的那一項,會把帶有source屬性的<Context.../>節點從server.xml中單獨分離出來,這樣就消除了警告。相關的改動:①上述servers.xml中的saveSeparateContextFiles屬性將被設置爲true;②tmp0/conf/server.xml中的報錯節點<Context>將被移動至tmp0/conf/Catalina/localhost/appName.xml中。


參考資料:

http://blog.csdn.net/anglebeat/article/details/23995967

https://my.oschina.net/uniquejava/blog/80945

發佈了38 篇原創文章 · 獲贊 23 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章