Caused by: Unable to load jar:file:/.../struts2-spring-plugin-2.3.4.1.jar!/struts-plugin.xml
Caused by: Connection refused: connect
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
Struts2 核心版本與 Spring 插件版本不一致。`struts2-spring-plugin-2.3.4.1.jar` 內部的 `struts-plugin.xml` 可能引用了 DTD/XSD 檔案,解析時嘗試從網絡下載 (如 `https://struts.apache.org/dtds/struts-2.3.dtd`),但網絡不通或檔案不存在,導致 `Connection refused`。版本不匹配時,類路徑衝突也會引發類似解析錯誤。
2.5.33
org.apache.struts
struts2-core
${struts2.version}
org.apache.struts
struts2-spring-plugin
${struts2.version}
org.apache.struts
struts2-json-plugin
${struts2.version}
| Struts2 Core | Spring Plugin | Spring 版本建議 | 備註 |
|---|---|---|---|
| 2.5.x (最新維護) | 2.5.x | 5.3.x | 推薦新專案 |
| 2.3.37 (終結版) | 2.3.37 | 4.3.x / 5.0.x | 舊專案維護 |
| 2.3.16.3 | 2.3.16.3 | 3.2.x / 4.0.x | 題目解決版本 |
| 2.3.4.1 | 2.3.4.1 | 3.1.x | 極舊,含已知安全漏洞 (CVE-2013-xxxx) |