Java 将战争部署到 JBoss AS 7(域模式)时出错:“无法处理部署阶段结构”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18855728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 11:39:36  来源:igfitidea点击:

Error deploying war into JBoss AS 7 (domain mode): "Failed to process phase STRUCTURE of deployment"

javadeploymentjbossjboss7.x

提问by thiagoh

I'm trying to deploy my war into JBoss AS 7 in domain mode, and I'm getting this error:

我正在尝试以域模式将我的战争部署到 JBoss AS 7 中,但出现此错误:

[Server:node02] 13:51:46,049 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11) MSC00001: Failed to start service jboss.deployment.unit."ROOT.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "ROOT.war"
[Server:node02]         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[Server:node02]         at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[Server:node02]         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[Server:node02]         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
[Server:node02]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
[Server:node02]         at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
[Server:node02] Caused by: java.lang.IllegalArgumentException: Given parent is not an ancestor of this virtual file
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:116) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:110) [jboss-vfs-3.1.0.Final.jar:3.1.0.Final]
[Server:node02]         at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.createAdditionalModule(ManifestClassPathProcessor.java:193) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[Server:node02]         at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.handlingExistingClassPathEntry(ManifestClassPathProcessor.java:185) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[Server:node02]         at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.deploy(ManifestClassPathProcessor.java:162) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[Server:node02]         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
[Server:node02]         ... 5 more
[Server:node02]
[Server:node02] 13:51:46,060 INFO  [org.jboss.as.server] (host-controller-connection-threads - 3) JBAS015870: Deploy of deployment "ROOT.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"ROOT.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"ROOT.war\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"ROOT.war\""}}
[Server:node02] 13:51:46,062 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015877: Stopped deployment ROOT.war in 1ms
[Server:node02] 13:51:46,063 INFO  [org.jboss.as.controller] (host-controller-connection-threads - 3) JBAS014774: Service status report
[Server:node02] JBAS014777:   Services which failed to start:      service jboss.deployment.unit."ROOT.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "ROOT.war"
[Server:node02]

My jboss-deployment-structure.xml is bellow

我的 jboss-deployment-structure.xml 如下

<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
    <deployment>
        <exclusions>
            <module name="org.slf4j" />
            <module name="org.slf4j.impl" />
<!--            <module name="org.hibernate" /> -->
        </exclusions>
        <!-- This allows you to define additional dependencies, it is the same 
            as using the Dependencies: manifest attribute -->
        <dependencies>
            <module name="deployment.sun.jdk" />
        </dependencies>
    </deployment>
    <!-- This is a module that re-exports the containers version of javassist.util.proxy -->
    <!-- This means that there is only one version of the Proxy classes defined -->
    <module name="deployment.sun.jdk">
        <dependencies>
            <module name="sun.jdk">
                <imports>
                    <include path="com/sun/crypto" />
                    <include path="com/sun/crypto/provider" />
                    <include path="com/sun/image/codec/jpeg" />
                    <include path="com/sun/org/apache/xml/internal/resolver" />
                    <include path="com/sun/org/apache/xml/internal/resolver/tools" />
                </imports>
            </module>
        </dependencies>
    </module>
</jboss-deployment-structure>

采纳答案by thiagoh

This is a bug in JBOSS AS version 7.1.1-Final, and it's fixed in newer versions.

这是 JBOSS AS 7.1.1-Final 版本中的一个错误,在较新的版本中已修复。

As the good arcticle The curious case of JBoss AS 7.1.2 and 7.1.3explains JBoss AS 7.1.1 is full of bugs.

作为好文章JBoss AS 7.1.2 和 7.1.3 的奇怪案例说明 JBoss AS 7.1.1 充满了错误。

So I've built JBoss 7.2.0 from the source and this error no longer occurs.

所以我从源代码构建了 JBoss 7.2.0,并且不再出现此错误。

回答by Fuzzy Analysis

I just got this issue with EAP 6.1 and JBoss Developer Studio 6.0. I had moved from using EAP Server 6.0 to 6.1. The fix was to remove allinstances of the *.war file in question from my machine, then do a Full Publish of the .war project after restarting the new EAP 6.1 Runtime Server.

我刚刚在 EAP 6.1 和 JBoss Developer Studio 6.0 上遇到了这个问题。我已经从使用 EAP Server 6.0 转移到 6.1。修复方法是从我的机器中删除有问题的 *.war 文件的所有实例,然后在重新启动新的 EAP 6.1 运行时服务器后完全发布 .war 项目。

回答by Chetan S. Choudhary

I also facing same issue when upgrading my app from jboss5 to jboss-as-7.1.1 and After full day research changing the version to jboss-as-7.1.3.Final solved my problem.
jboss-as-7.1.3.Finalis not directly downloadable, Developer have to build it himself, building-jboss-as-7.1.3.Finalshows complete process of building jboss-as-7.1.3.Final.

将我的应用程序从 jboss5 升级到 jboss-as-7.1.1 时,我也面临同样的问题,经过一整天的研究,将版本更改为 jboss-as-7.1.3.Final 解决了我的问题。
jboss-as-7.1.3.Final不能直接下载,需要开发者自己构建,building-jboss-as-7.1.3.Final展示了构建jboss-as-7.1.3.Final的完整过程。

Hope this help someone.

希望这有助于某人。

回答by Marcos Milit?o

I also facing the same issue, solve it after changing the java jdk version 1.6 to 1.7.

我也面临同样的问题,将java jdk 1.6版本改为1.7后解决。