Web项目在Tomcat上运行,但在jboss 6上部署失败

时间:2014-01-09 12:52:40

标签: hibernate tomcat web-deployment jboss6.x web-project

我正在部署一个在tomcat上正常运行的战争,但我无法在jboss上部署它。

18:05:26,638 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."mywebproject2.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."mywebproject2.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "mywebproject2.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_24]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24]
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:117)
    at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:129)
    at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:67)
    at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    ... 5 more
Caused by: java.lang.reflect.UndeclaredThrowableException
    at $Proxy21.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:672)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.getExtraClass(JaxWsServiceFactoryBean.java:642)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:484)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:204)
    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:1605) [rt.jar:1.6.0_24]
    at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:52)
    ... 28 more

18:05:26,682 ERROR [org.jboss.as.server] (HttpManagementService-threads - 3) JBAS015870: Deploy of deployment "mywebproject2.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"mywebproject2.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mywebproject2.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"mywebproject2.war\"
    Caused by: javax.xml.ws.WebServiceException: java.lang.reflect.UndeclaredThrowableException
    Caused by: java.lang.reflect.UndeclaredThrowableException
    Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)"}}
18:05:31,264 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment mywebproject2.war (runtime-name: mywebproject2.war) in 4582ms

1 个答案:

答案 0 :(得分:0)

当您添加的库使用asm.jar时会发生此问题。 JBoss将自己的asm.jar放在%JBOSS_HOME%\system\layers\base\asm\asm\main中,这可能会导致与其他包含的版本冲突。我注意到你通常可以用JBoss做一个干净的开始,但是如果部署包含多个asm-jar的war / jar,重新部署新的war或ear文件将会失败。

解决方案是找出哪些库使用asm.jar然后将其排除。 如果你使用Maven,你可以在你的pom中添加这样的东西:

<exclusions>
    <exclusion>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
    </exclusion>
</exclusions>

或者,您可以在jboss-deployment-structure.xml

中排除asm.jar

此处还有更多信息:https://developer.jboss.org/message/823745