一、問題背景
- 使用指令啟動wildfly伺服器時報錯如下:
::, ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "YZYWeiXin.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"YZYWeiXin.war#cnsoftbei-yzy\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"YZYWeiXin.war#cnsoftbei-yzy\": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"YZYWeiXin.war#cnsoftbei-yzy\""],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
::, ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "labmanagement.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"labmanagement.war#labUnit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"labmanagement.war#labUnit\": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"labmanagement.war#labUnit\""],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
::, ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "jpa.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"jpa.war#engine_diagnosis_system\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"jpa.war#engine_diagnosis_system\": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"jpa.war#engine_diagnosis_system\""],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
::, ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "EngineDiagnosisSystem.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"EngineDiagnosisSystem.war#engine_diagnosis_system\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"EngineDiagnosisSystem.war#engine_diagnosis_system\": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"EngineDiagnosisSystem.war#engine_diagnosis_system\""],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
2.$WILDFLY_HOME/standalone/deploments/下standalone.xml檔案下:
二、問題分析
個人認為應該是之前部署在wildfly伺服器上的項目存在沖突,導緻報出dom4j錯誤。
三、問題解決
将$WILDFLY_HOME/standalone/deploments/standalone.xml中的
<deployments>
</deployments>
部署的項目删掉即可。