Index: src/main/java/org/jboss/deployment/EARStructure.java =================================================================== --- src/main/java/org/jboss/deployment/EARStructure.java (revision 111994) +++ src/main/java/org/jboss/deployment/EARStructure.java (working copy) @@ -209,11 +209,12 @@ { Automounter.mount(file, archive); addClassPath(structureContext, archive, true, true, context); - // add any jars with persistence.xml as a deployment - if (archive.getChild("META-INF/persistence.xml").exists()) + // add any persistence.xml as a deployment + VirtualFile persistenceXml = archive.getChild("META-INF/persistence.xml"); + if (persistenceXml.exists()) { log.trace(archive.getName() + " in ear lib directory has persistence units"); - if (structureContext.determineChildStructure(archive) == false) + if (structureContext.determineChildStructure(persistenceXml) == false) { throw new RuntimeException(archive.getName() + " in lib directory has persistence.xml but is not a recognized deployment, .ear: "