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

时间:2020-08-27 06:42:50

标签: eclipse eclipse-rcp axis2 java-11

我正在升级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调用(我在其他地方已经完成了一些更简单的方法的调用),但是该服务非常重要,实现起来非常耗时。

0 个答案:

没有答案
相关问题