在使用 Ibatis 開發時,經常會在 sqlMap 或 sqlMapConfig 配置文件中遇到如下錯誤提示:
Referenced file contains errors (https://www.ibatis.com/dtd/sql-map-config-2.dtd). For more information, right click on the message in the Problems View and select "Show Details..."
同樣的錯誤也可能出現在 Spring 的配置文件中。網上許多解決方案說法模糊,實際上這屬於配置文件的驗證錯誤,不影響項目正常運行。此時我們可以選擇關閉 Eclipse 的 XML 驗證功能來消除紅叉提示。
Window -- Preferences -- General -- Validation這樣就能屏蔽針對 DTD 文件的驗證錯誤,不影響實際開發與部署。