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

问题描述 投票:0回答:1

我正在部署一个在tomcat上运行良好的war,但我无法将它部署在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
hibernate tomcat deployment jboss6.x
1个回答
0
投票

当您添加的库使用asm.jar 时,就会出现此问题。 JBoss 有自己的 asm.jar 位于

%JBOSS_HOME%\system\layers\base\asm\asm\main
中,这可能会导致与其他包含的版本发生冲突。我注意到您通常可以使用 JBoss 重新启动,但如果部署的 war/jar 包含多个 asm-jar,则重新部署新的 war 或ear 文件将会失败。

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

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

或者,您可以在 jboss-deployment-struct.xml 中排除 asm.jar

更多信息也在这里:https://developer.jboss.org/message/823745

© www.soinside.com 2019 - 2024. All rights reserved.