无法加载com.sun.xml.ws.api.suapversion com.sun.sun.wsopversion。
我们的 Web 应用程序在 Glassfish 3 上运行良好,我们希望迁移到 Glassfish 4 及更高版本。
当我将 war 文件部署到 Glassfish 4 时,出现以下异常:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.SOAPVersion
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:593)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:475)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:249)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:209)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:178)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:364)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:322)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:231)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:212)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:208)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:119)
at javax.xml.ws.Service.<init>(Service.java:92)
在 Glassfish 3 上没有 JaxWS 的实现,并且使用 Java 运行时的默认实现。
javax.xml.ws.Service
com.sun.xml.internal.ws.client.WSServiceDelegate
com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser
在 Glassfish 4 上,有两个 jar 文件可以替换/覆盖此功能。
webservices-api-osgi.jar and
webservices-osgi.jar
webservices-api-osgi.jar 包含新的服务类 javax.xml.Service,然后它使用类 com.sun.xml.ws.*,如异常中所示。
我不明白的是为什么在 webservices-osgi.jar 中找不到 com.sun.xml.ws.api.SOAPVersion 类,就像 com.sun.xml.ws.client.WSServiceDelegate 和 com.sun 一样。 xml.ws.wsdl.parser.RuntimeWSDLParser。
Glassfish3 和 Glassfish4 都运行在 Oracle Java8 JDK 上。
Our Web-Application runs fine on Glassfish 3 and we want to migrate to Glassfish 4 and beyond.
When i deploy the war file to Glassfish 4 i get the following Exception:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.api.SOAPVersion
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:593)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:475)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:249)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:209)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:178)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:364)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:322)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:231)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:212)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:208)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:119)
at javax.xml.ws.Service.<init>(Service.java:92)
On Glassfish 3 there is no implementation of JaxWS and the default Implementation of the Java Runtime is used.
javax.xml.ws.Service
com.sun.xml.internal.ws.client.WSServiceDelegate
com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser
On Glassfish 4 there are two jarfiles who replace/overwrite this functionality.
webservices-api-osgi.jar and
webservices-osgi.jar
webservices-api-osgi.jar contains the new Service class javax.xml.Service which then uses the classes com.sun.xml.ws.* as shown in the exception.
What i don't understand is why the class com.sun.xml.ws.api.SOAPVersion is not found it exist in webservices-osgi.jar just like com.sun.xml.ws.client.WSServiceDelegate and com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.
Both Glassfish3 and Glassfish4 run on Oracle Java8 JDK.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论