java.lang.ClassNotFoundException:com.sun.xml.internal.ws.spi.ProviderImpl

时间:2017-05-24 19:41:29

标签: java web-services jboss wildfly

我在Wildfly 10 / Java 8中运行一个耳朵。我正在使用基于CXF的Web服务客户端jar和我的耳朵。我已将DmsWSClient.jar与相应的依赖项一起放入我的模块中。 Wildfly干净利落地开始。但是当我尝试在DOSWSClient.jar中实例化DmsWSClient类时,我得到以下例外:

javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:64)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:166)
at javax.xml.ws.spi.Provider.provider(Provider.java:142)
at javax.xml.ws.Service.<init>(Service.java:92)
at com.tybera.dms.impl.IDmsServicesImplService.<init>(IDmsServicesImplService.java:44)
at com.tybera.dms.DmsClient.<init>(DmsClient.java:78)
at com.eflex.file.DocStoreManager.saveFile(DocStoreManager.java:952)
at com.signer.docproc.DocumentControllerJBean.saveToFile(DocumentControllerJBean.java:2492)
at com.eflex.worklist.WorklistProcessor.mainFormSubmit(WorklistProcessor.java:1566)
at com.eflex.worklist.WorklistProcessor.processMainFormSubmit(WorklistProcessor.java:1417)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.tybera.servlet.BasicProcessor.processRequest(BasicProcessor.java:207)
at com.tybera.servlet.BasicLoginProcessor.processRequest(BasicLoginProcessor.java:72)
at com.tybera.servlet.BasicServlet.doGet(BasicServlet.java:22)
at com.tybera.servlet.BasicServlet.doPost(BasicServlet.java:36)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl from [Module "deployment.signer.ear.signer.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:196)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:61)

我已阅读Wildfly Class Loading,我认为我已经包含了所有必要的模块。我将DmsWSClient.jar列为我耳朵的jboss-deployment-structure.xml中的依赖项。

<?xml version="1.0"?>
<jboss-deployment-structure>
  <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
     <dependencies>
    <module name="com.tybera.dms.DmsWSClient" export="true"/>
        <module name="com.sun.xml.bind" export="true"/>
        <module name="javax.activation.api" export="true"/>
        <module name="javax.el.api" export="true"/>
        <module name="javax.enterprise.api" export="true"/>
        <module name="javax.faces.api" export="true"/>
        <module name="javax.inject.api" export="true"/>
        <module name="javax.interceptor.api" export="true"/>
        <module name="javax.jms.api" export="true"/>
        <module name="javax.resource.api" export="true"/>
        <module name="javax.rmi.api" export="true"/>
        <module name="javax.servlet.api" export="true"/>
        <module name="javax.servlet.jsp.api" export="true"/>
        <module name="javax.transaction.api" export="true"/>
        <module name="javax.validation.api" export="true"/>
        <module name="javax.xml.rpc.api" export="true"/>
        <module name="net.sourceforge.nekohtml" export="true"/>
        <module name="org.apache.commons.beanutils" export="true"/>
        <module name="org.apache.cxf" export="true"/>
        <module name="org.apache.log4j" export="true"/>
        <module name="org.apache.xalan" export="true"/>
        <module name="org.apache.xerces" export="true"/>
       <module name="org.hibernate" export="true"/>
        <module name="org.hibernate.validator" export="true"/>
        <module name="org.jaxen" export="true"/>
        <module name="org.junit" export="true"/>
        <module name="org.slf4j" export="true"/>
     <module name="org.jboss.xnio" export="true"/>
    <module name="org.apache.velocity" export="true"/>
    <!--<module name="system"/>-->
     </dependencies>
  </deployment>
</jboss-deployment-structure>

我在模块中有DmsWSClient.jar。

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.tybera.dms.DmsWSClient">
  <resources>
    <resource-root path="DmsWSClient-0.0.2.6.jar" />
   </resources>
  <dependencies>
    <module name="javax.xml.ws.jaxws-api" />
    <module name="org.apache.cxf.cxf-rt-frontend-jaxws" />
    <module name="org.apache.cxf.cxf-rt-transports-http" />
    <module name="org.springframework.spring-web" />
    <module name="javax.activation.api"/>
    <module name="axis-jaxrpc"/>
  </dependencies>
</module>

我可以从详细的类加载中看到,正在加载Java 8&#'s rt.jar中的许多其他类。我可以看到所需的ProviderImpl在Java 8的rt.jar中。为什么Wildfly不能找到这个ProviderImpl类?我应该依赖其他一些罐吗?

我甚至尝试通过系统属性强制使用org.apache.cxf.jaxws.spi.ProviderImpl并获得相同的消息(但是没有找到apache ProviderImpl)。

我不知所措,真的很感激一些想法。

0 个答案:

没有答案