nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPElement

JavaSE 8 includes package java.xml.soap.
JavaSE 9 moved package javax.xml.soap to the module java.xml.ws.
Modules shared with JEE (like java.xml.ws) are included in JavaSE 9, but are
deprecated for removal from a future version of JavaSE, and
not on the default module path.html

A quick workaround is to either
- run the jar with JRE 8: $MY_JRE8_HOME/bin/java -jar my.jar, or
- add a module for JRE 9: java --add-modules java.xml.ws -jar my.jarjava

Longer term, JavaSE projects that use modules like java.xml.ws must explicitly include the module like other libraries.web

See https://stackoverflow.com/a/46359097
See JDK 9 Migration Guide: Modules Shared with JEE Not Resolved by Defaultspring

(Reproduced NoClassDefError and workarounds with zipped SOAP web service project at https://spring.io/guides/gs/producing-web-service/)oracle

 

譯文:ide

JavaSE 8包含包java.xml.soap
JavaSE 9將包移動javax.xml.soap到模塊java.xml.ws
與JEE(如共享的模塊java.xml.ws)包括在JavaSE的9,但
棄用用於去除從JavaSE中的將來版本,以及
不是默認模塊路徑上post

一個快速的解決方法是
- 使用JRE 8運行jar:$MY_JRE8_HOME/bin/java -jar my.jar
- 爲JRE 9添加模塊:java --add-modules java.xml.ws -jar my.jarui

從長遠來看,使用相似模塊的JavaSE項目java.xml.ws必須像其餘庫同樣明確地包含模塊。spa

請參閱https://stackoverflow.com/a/46359097
請參閱JDK 9遷移指南:與JEE共享的模塊默認狀況下未解析code

(在https://spring.io/guides/gs/producing-web-service/上重現了NoClassDefError和壓縮SOAP Web服務項目的變通方法

相關文章
相關標籤/搜索