javax.xml.ws.WebServiceException:javax.xml.ws.WebServiceException:无法实例化处理程序

时间:2017-08-16 07:20:03

标签: web-services soap jboss java-8 jboss7.x

我正在尝试将基于SOAP的Web服务war文件部署到Jboss eap-7.0但是失败了。使用JDK 1.8。 我通常能够在jboss-as-5中部署它。现在要在Jboss-7中部署它,我刚刚在WEB-INF文件夹中添加了jboss-deployment-descriptor。我为另一个Web服务模块做了同样的事情,它工作正常。

11:22:51,785 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-7) Setting the server's publish address to be http://localhost:8080/brazil-auth-webservice
11:22:51,920 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."brazil-ent-ws.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."brazil-ent-ws.war".INSTALL: WFLYSRV0153: Failed to process phase INSTA
LL of deployment "brazil-ent-ws.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        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: javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: Failed to instantiate handler
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
        at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:79)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
        at org.jboss.wsf.stack.cxf.configuration.BusHolder.configure(BusHolder.java:234)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:97)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:59)
        at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
        ... 5 more
Caused by: javax.xml.ws.WebServiceException: Failed to instantiate handler
        at org.apache.cxf.jaxws.handler.HandlerChainBuilder.buildHandlerChain(HandlerChainBuilder.java:138)
        at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.processHandlerElement(AnnotationHandlerChainBuilder.java:271)
        at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.processHandlerChainElement(AnnotationHandlerChainBuilder.java:171)
        at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:124)
        at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:288)
        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.buildHandlerChain(JaxWsServerFactoryBean.java:249)
        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.initializeResourcesAndHandlerChain(JaxWsServerFactoryBean.java:227)
        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:212)
        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
        ... 13 more
Caused by: java.lang.NullPointerException
        at com.brazil.authn.ws.util.ConfigUtil.getWSKeystoreFilename(ConfigUtil.java:131)
        at com.brazil.authn.ws.util.NAFAuthnWSServerSecurityMessageHandler.<init>(NAFAuthnWSServerSecurityMessageHandler.java:44)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.apache.cxf.jaxws.handler.HandlerChainBuilder.buildHandlerChain(HandlerChainBuilder.java:131)
        ... 22 more

下面是jboss 7 eap中存在的module.xml(jboss-eap-7.0 \ modules \ system \ layers \ base \ org \ jboss \ xts \ main)

      <?xml version="1.0" encoding="UTF-8"?>



        <module xmlns="urn:jboss:module:1.3" name="org.jboss.xts">

            <resources>
               <resource-root path="jbossxts-5.2.16.Final-redhat-1.jar"/> 
               <resource-root path="jbosstxbridge-5.2.16.Final-redhat-1.jar"/> 
             </resources>

            <dependencies>
                <module name="javax.transaction.api"/>
                <module name="javax.resource.api"/>
                <module name="org.jboss.jts"/>
                <module name="org.jboss.ws.api" services="export"/>
                <module name="org.jboss.ws.jaxws-client" services="export"/>
                <module name="org.jboss.ws.cxf.jbossws-cxf-client" services="export"/>
                <module name="org.jboss.logging"/>
                <module name="javax.xml.soap.api"/>
                <module name="javax.xml.ws.api"/>
                <module name="javax.xml.stream.api"/>
                <!-- this is needed to get javax.xml.namespace.QName but it would be better if it were exposed on its own -->
                <module name="javax.api"/>
                <!-- this is needed because our endpoints are not in a normal deployment and we need to be able
                    to resolve the javax.jws.WebService annotation attached to them. presumably an endpoint
                    found in a deployment gets this package auto-added to its module loader
                    -->
                <module name="javax.jws.api"/>
                <!-- this is needed to ensure @Resource annotations on the JaxWS endpoint classes are in the
                     classloader scope-->
                <module name="javax.annotation.api"/>
                <!-- this is needed to ensure the JaxWS endpoint classes canb refer to HttpServletRequest etc -->
                <module name="javax.servlet.api"/>
                <module name="javax.ejb.api" />
                <module name="org.jboss.jts" />
                <module name="javax.xml.ws.api" />
                <module name="org.jboss.weld.api" />
                <module name="org.jboss.weld.core" />
                <module name="javax.enterprise.api"/>
                <module name="javax.transaction.api" />
                <module name="org.jboss.logging" />
                <module name="org.jboss.narayana.compensations" export="true" />
                <module name="org.jboss.narayana.txframework" export="true" />
                <module name="javax.annotation.api"  export="true" />
                <module name="javax.interceptor.api"  export="true" />
                <module name="org.jboss.weld.spi" />

                <!-- TODO WFLY-5966 validate the need for these and remove if not needed.
                     Prior to WFLY-5922 they were exported by javax.ejb.api. -->
                <module name="javax.xml.rpc.api"/>
                <module name="javax.rmi.api"/>
                <module name="org.omg.api"/>
            </dependencies>
        </module>

0 个答案:

没有答案