web服务 – 在Jboss 6.3.0 EAP中部署Java WS时出错

前端之家收集整理的这篇文章主要介绍了web服务 – 在Jboss 6.3.0 EAP中部署Java WS时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用 Java WS从Jboss 5.1.0迁移到Jboss 6.3.0 EAP的应用程序.它适用于Jboss 5.1.0但在Jboss 6.3.0 EAP中部署相同时遇到错误.
14:42:10,887 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deploy
ment.unit."my-app.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."dtm-banking.
war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "dtm-banking.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-a
s-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-ms
c-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.F
inal-redhat-1.jar:1.1.5.Final-redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
Caused by: javax.xml.ws.WebServiceException: java.lang.reflect.UndeclaredThrowableException
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
        at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:66)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)
        at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:118)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:137
)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:69)
        at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-a
s-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
        ... 5 more
Caused by: java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy371.visitLabel(Unknown Source)
        at org.apache.cxf.jaxws.WrapperClassGenerator.createWrapperClass(WrapperClassGenerator.java:213)
        at org.apache.cxf.jaxws.WrapperClassGenerator.generate(WrapperClassGenerator.java:122)
        at org.apache.cxf.jaxws.support.JaxWsServicefactorybean.generatedWrapperBeanClass(JaxWsServicefactorybean.java:6
83)
        at org.apache.cxf.jaxws.support.JaxWsServicefactorybean.getExtraClass(JaxWsServicefactorybean.java:653)
        at org.apache.cxf.service.factory.ReflectionServicefactorybean.buildServiceFromClass(ReflectionServiceFactoryBea
n.java:484)
        at org.apache.cxf.jaxws.support.JaxWsServicefactorybean.buildServiceFromClass(JaxWsServicefactorybean.java:704)
        at org.apache.cxf.service.factory.ReflectionServicefactorybean.initializeServiceModel(ReflectionServiceFactoryBe
an.java:550)
        at org.apache.cxf.service.factory.ReflectionServicefactorybean.create(ReflectionServicefactorybean.java:265)
        at org.apache.cxf.jaxws.support.JaxWsServicefactorybean.create(JaxWsServicefactorybean.java:215)
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
:102)
        at org.apache.cxf.frontend.Serverfactorybean.create(Serverfactorybean.java:159)
        at org.apache.cxf.jaxws.JaxWsServerfactorybean.create(JaxWsServerfactorybean.java:211)
        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
        ... 13 more
Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)
        at java.lang.Class.getMethod(Class.java:1665) [rt.jar:1.7.0_60]
        at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:85)
        ... 28 more

我理解Jboss 6.3.0 EAP使用CXF实现webservice,但我正在寻找简单的Java WS来使用标准的Java EE环境.

在jboss-deployment-structure.xml中尝试了以下内容

<exclude-subsystems>
    <subsystem name="webservices" />
</exclude-subsystems>

这在部署时摆脱了异常,但在调用服务的wsdl时我得到了一个Classcast异常

http://localhost:8080/myapp/myservice?wsdl

JBWEB000235:为servlet MyWebService分配异常:java.lang.ClassCastException:com.example.webservice.endpoint.DataService无法强制转换为javax.servlet.Servlet

任何的想法?

解决方法

问题是在部署中捆绑asm.jar.
尝试删除它并将其添加到您的jboss-deployment-structure.xml:
<jboss-deployment-structure>
    <deployment>
       <dependencies>
            ...
            <module name="asm.asm" />
            ...
        </dependencies>
    </deployment>
</jboss-deployment-structure>

查看更多:https://developer.jboss.org/message/823745

原文链接:https://www.f2er.com/html/224033.html

猜你在找的HTML相关文章