在迁移到 JBoss7.2 时未找到 javax.xml.ws.spi.ProviderImpl

Not found javax.xml.ws.spi.ProviderImpl in migration to JBoss7.2

环境:

迁移自:

我正在从 JBoss 5.2 迁移到 Jboss 7.2,我遇到了 WS soap 的错误,它没有找到 ProviderImpl,因为它来自旧的实现 com.sun.xml.internal.ws.spi.ProviderImpl。 我应该删除文件 resources/META-INF/services/javax.xml.ws.spi.Provider 以获得 JBoss 7.2 上的默认实现吗?或更改它?

EmpleoWeb

/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.4-b01
 * Generated source version: 2.2
 * 
 */
@WebServiceClient(name = "EmpleoWeb", targetNamespace = "http://namespace.softwareag.com/entirex/xml/mapping", wsdlLocation = "http://intra.web.es/WebServicesEntireX/services/EmpleoWeb?wsdl")
public class EmpleoWeb extends Service {

    private final static URL EMPLEOWEB_WSDL_LOCATION;
    private final static WebServiceException EMPLEOWEB_EXCEPTION;
    private final static QName EMPLEOWEB_QNAME = new QName("http://namespace.softwareag.com/entirex/xml/mapping", "EmpleoWeb");

    static {
        URL url = null;
        WebServiceException e = null;
        try {
            url = new URL("http://intra.web.es/WebServicesEntireX/services/EmpleoWeb?wsdl");
        } catch (MalformedURLException ex) {
            e = new WebServiceException(ex);
        }
        EMPLEOWEB_WSDL_LOCATION = url;
        EMPLEOWEB_EXCEPTION = e;
    }

    public EmpleoWeb() {
        super(__getWsdlLocation(), EMPLEOWEB_QNAME);
    }

    public EmpleoWeb(WebServiceFeature... features) {
        super(__getWsdlLocation(), EMPLEOWEB_QNAME, features);
    }

    public EmpleoWeb(URL wsdlLocation) {
        super(wsdlLocation, EMPLEOWEB_QNAME);//ERROR
    }
    ...

resources/META-INF/services/javax.xml.ws.spi.Provider

com.sun.xml.internal.ws.spi.ProviderImpl

错误日志

原因:java.util.ServiceConfigurationError:javax.xml.ws.spi.Provider:未找到提供者com.sun.xml.internal.ws.spi.ProviderImpl

...
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.weld.core@3.0.5.Final-redhat-00001//org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:83)
    ... 146 more
Caused by: javax.xml.ws.WebServiceException: Error while searching for service [javax.xml.ws.spi.Provider]
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.FactoryFinder.createException(FactoryFinder.java:65)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.FactoryFinder.createException(FactoryFinder.java:62)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.ServiceLoaderUtil.firstByServiceLoader(ServiceLoaderUtil.java:74)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:93)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.Provider.provider(Provider.java:96)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.Service.<init>(Service.java:112)
    at deployment.accfor2.ear.accfor-ejb.jar//es.caib.accfor.business.io.ws.silcoi.entity.wsdl.empleo.EmpleoWeb.<init>(EmpleoWeb.java:50)
    at deployment.accfor2.ear.accfor-ejb.jar//es.caib.accfor.business.io.ws.silcoi.boundary.SilcoiClient.setWsdlEmpleoWeb(SilcoiClient.java:339)
    at deployment.accfor2.ear.accfor-ejb.jar//es.caib.accfor.business.io.ws.silcoi.boundary.SilcoiClient.<init>(SilcoiClient.java:45)
    at deployment.accfor2.ear.accfor-back.war//es.caib.accfor.presentation.back.io.ws.silcoi.SilcoiBean.init(SilcoiBean.java:43)
    ... 151 more
Caused by: java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
    at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1211)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
    at java.base/java.util.ServiceLoader.hasNext(ServiceLoader.java:1299)
    at java.base/java.util.ServiceLoader.hasNext(ServiceLoader.java:1384)
    at javax.xml.ws.api@1.0.0.Final-redhat-1//javax.xml.ws.spi.ServiceLoaderUtil.firstByServiceLoader(ServiceLoaderUtil.java:67)
    ... 158 more

关注 Oracle JDK Migration Guide and JEP 320: Remove the Java EE and CORBA Modules

我根据 maven 项目添加了以下内容以跟上 运行。

    <!-- JAXWS for Java 11 -->
    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>2.3.0</version>
    </dependency>

我必须下载 jaxws-rt-2.3。0.jar 并添加到 /lib 文件夹。