7
votes

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.

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.

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

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.

<?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.

2

2 Answers

3
votes

It seems like eclipse issue, may happen when dependant project of an ear not built properly.

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 separately by "mvn install" and then try deploying ear on your server. It worked for me.

1
votes

org.jboss.as.server.deployment.DeploymentUnitProcessingException: Sub deployment SampleEJB.jar in jboss-structure.xml was not found.

It seems SampleEJB.jar is not deployed yet. Create deployment structure file to deploy components in order.