如何将Axis2 Jaxws运行时添加到RCP应用程序

问题描述

我正在升级RCP应用程序,并且目前专注于从Java 8到Java 11的迁移。这带来了许多问题,我可以通过添加Orbit项目中的捆绑软件解决大多数问题。 (请参阅我之前的问题:How best to provide JAXB components in an RCP application

当应用程序运行并尝试调用SOAP Web服务时,出现以下错误:

Caused by: javax.xml.ws.spi.FactoryFinder$ConfigurationError: Provider org.apache.axis2.jaxws.spi.Provider not found

我假设我添加的捆绑包不提供运行时。

我可以添加一个运行时捆绑软件吗?我尝试添加Axis Tools功能,但找不到任何看起来像运行时的​​东西。

更新

我在插件的类路径中添加了jaxws-rt.jarjakarta.xml.ws-api-3.0.0-RC3.jarjakarta.xml.bind-api-3.0.0-RC3.jar,并更改了getService方法以暂时使用其他加载程序(如{{ 3}})。

final ClassLoader targetClassLoader = Devices.class.getClassLoader();
final Thread currentThread = Thread.currentThread();
final ClassLoader contextClassLoader = currentThread.getContextClassLoader();
try {
    currentThread.setContextClassLoader(targetClassLoader);
    Devices ss = new Devices(getURL(),SERVICE_NAME);
    service = ss.getBasicHttpBindingIDevices();
}
catch (Exception e) {
    throw new AtfException(Messages.AbstractProxyDevice_0,e);
}
finally {
    currentThread.setContextClassLoader(contextClassLoader);
}

我现在得到

java.lang.ClassCastException: class com.sun.xml.ws.spi.ProviderImpl cannot be cast to class javax.xml.ws.spi.Provider (com.sun.xml.ws.spi.ProviderImpl is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @138165e2; javax.xml.ws.spi.Provider is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @78f41d31)

我已经考虑过手工生成SOAP调用(我在其他地方已经完成了一些更简单的方法的调用),但是该服务非常重要,实现起来非常耗时。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...