无法加载com.sun.xml.ws.api.suapversion com.sun.sun.wsopversion。

发布于 2025-01-17 11:14:30 字数 1850 浏览 3 评论 0原文

我们的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文