Java 无法处理部署的阶段结构
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21940739/
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
Failed to process phase STRUCTURE of deployment
提问by Xanathos
I read in other topics, but I can't quite figure this out. I have an EJB module that uses log4j. I want to package that EJB into a JAR file and put in the WEB-INF/lib path of a web project. The web project has a servlet that executes a function from the EJB, and that's it. But seems that the appender doesn't work, for the file is created but not written.
我读过其他主题,但我不太明白这一点。我有一个使用 log4j 的 EJB 模块。我想将该 EJB 打包成一个 JAR 文件并放入一个 Web 项目的 WEB-INF/lib 路径中。Web 项目有一个 servlet,它执行来自 EJB 的功能,就是这样。但似乎附加程序不起作用,因为文件已创建但未写入。
I read that a deployment descriptor for JBoss, so I created one based on one of the previous posts. But i get a "Failed to process phase STRUCTURE of deployment" error.
我读到了 JBoss 的部署描述符,所以我根据之前的一篇文章创建了一个。但是我收到“无法处理部署阶段结构”错误。
12:04:44,905 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."SampleWeb.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."SampleWeb.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "SampleWeb.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_21] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_21] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_21] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Sub deployment SampleEJB.jar in jboss-structure.xml was not found. Available sub deployments: at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:233) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:159) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more
jar:1.7.0_21] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_21] 在 java.lang.Thread.run(Unknown Source) [rt.jar:1.7. 0_21] 导致:org.jboss.as.server.deployment.DeploymentUnitProcessingException:未找到 jboss-structure.xml 中的子部署 SampleEJB.jar。可用的子部署:在 org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:233) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]在 org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:159) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 在 org.jboss .as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:
Here's the jboss-deployment-structure.xml I created. Because the web project only uses the EJB jar file I created I assumed that the deployment tag is not used.
这是我创建的 jboss-deployment-structure.xml。因为 web 项目只使用我创建的 EJB jar 文件,所以我假设没有使用部署标记。
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<sub-deployment name="SampleEJB.jar">
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j" />
<module name="org.apache.commons.logging"/>
<module name="org.log4j"/>
<module name="org.jboss.logging"/>
</exclusions>
</sub-deployment>
</jboss-deployment-structure>
I'm using JBoss 7.1.1, by the way.
顺便说一下,我使用的是 JBoss 7.1.1。
回答by kosa
org.jboss.as.server.deployment.DeploymentUnitProcessingException: Sub deployment SampleEJB.jar in jboss-structure.xml was not found.
org.jboss.as.server.deployment.DeploymentUnitProcessingException:未找到jboss-structure.xml 中的子部署 SampleEJB.jar 。
It seems SampleEJB.jar
is not deployed yet. Create deployment structure fileto deploy components in order.
好像SampleEJB.jar
还没有部署。创建部署结构文件以按顺序部署组件。
回答by Parveen Verma
It seems like eclipse issue, may happen when dependant project of an ear not built properly.
看起来像是 eclipse 问题,可能会在未正确构建耳朵的依赖项目时发生。
In my case I was getting the same error with reason that ear was unable to find one included dependency jar. Just check that dependent project and check it's target directory where maven creates jar after building the project. It would be empty if maven does not build that project properly. Build that dependent project separatelyby "mvn install" and then try deploying ear on your server. It worked for me.
就我而言,我遇到了同样的错误,原因是耳朵无法找到一个包含的依赖 jar。只需检查该依赖项目并检查它是构建项目后 maven 创建 jar 的目标目录。如果 Maven 没有正确构建该项目,它将为空。 通过“mvn install”单独构建该依赖项目,然后尝试在您的服务器上部署ear。它对我有用。