Buggy code:
public class EjbJarParsingDeploymentUnitProcessor implements DeploymentUnitProcessor { private static Logger logger = Logger . getLogger ( EjbJarParsingDeploymentUnitProcessor . class ) ; private static final String WAR_FILE_EXTENSION = ".war" ; private static final String JAR_FILE_EXTENSION = ".jar" ; private static final String EJB_JAR_XML_LOCATION_IN_WAR = "WEB-INF//ejb-jar.xml" ; private static final String EJB_JAR_XML_LOCATION_IN_JAR = "META-INF//ejb-jar.xml" ; @ Override public void deploy ( DeploymentPhaseContext deploymentPhase ) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = deploymentPhase . getDeploymentUnit ( ) ; VirtualFile deploymentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; VirtualFile ejbJarXml = null ; if ( deploymentRoot . getName ( ) . toLowerCase ( ) . endsWith ( EjbJarParsingDeploymentUnitProcessor . WAR_FILE_EXTENSION ) ) { ejbJarXml = deploymentRoot . getChild ( EjbJarParsingDeploymentUnitProcessor . EJB_JAR_XML_LOCATION_IN_WAR ) ; } else if ( deploymentRoot . getName ( ) . toLowerCase ( ) . endsWith ( EjbJarParsingDeploymentUnitProcessor . JAR_FILE_EXTENSION ) ) { ejbJarXml = deploymentRoot . getChild ( EjbJarParsingDeploymentUnitProcessor . EJB_JAR_XML_LOCATION_IN_JAR ) ; } else { return ; } if ( ( ejbJarXml == null ) || ( ! ( ejbJarXml . exists ( ) ) ) ) { return ; } EjbDeploymentMarker . mark ( deploymentUnit ) ; if ( ! ( deploymentUnit . hasAttachment ( EJB_JAR_DESCRIPTION ) ) ) { final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; <START_BUG> final EjbJarDescription ejbModuleDescription = new EjbJarDescription ( moduleDescription ) ; <END_BUG> deploymentUnit . putAttachment ( EJB_JAR_DESCRIPTION , ejbModuleDescription ) ; } MetaDataElementParser . DTDInfo dtdInfo = new MetaDataElementParser . DTDInfo ( ) ; InputStream stream = null ; try { stream = ejbJarXml . openStream ( ) ; XMLStreamReader reader = this . getXMLStreamReader ( stream , ejbJarXml , dtdInfo ) ; EjbJarMetaData ejbJarMetaData = EjbJarMetaDataParser . parse ( reader , dtdInfo ) ; deploymentUnit . putAttachment ( EJB_JAR_METADATA , ejbJarMetaData ) ; } catch ( XMLStreamException xmlse ) { throw new DeploymentUnitProcessingException ( ( "Exception<seq2seq4repair_space>while<seq2seq4repair_space>parsing<seq2seq4repair_space>ejb-jar.xml:<seq2seq4repair_space>" + ( ejbJarXml . getPathName ( ) ) ) , xmlse ) ; } catch ( IOException ioe ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>reader<seq2seq4repair_space>for<seq2seq4repair_space>ejb-jar.xml:<seq2seq4repair_space>" + ( ejbJarXml . getPathName ( ) ) ) , ioe ) ; } finally { try { if ( stream != null ) { stream . close ( ) ; } } catch ( IOException ioe ) { EjbJarParsingDeploymentUnitProcessor . logger . debug ( "Ignoring<seq2seq4repair_space>exception<seq2seq4repair_space>while<seq2seq4repair_space>closing<seq2seq4repair_space>the<seq2seq4repair_space>InputStream<seq2seq4repair_space>" , ioe ) ; } } } @ Override public void undeploy ( DeploymentUnit unit ) { } private XMLStreamReader getXMLStreamReader ( InputStream stream , VirtualFile ejbJarXml , XMLResolver resolver ) throws DeploymentUnitProcessingException { } }

Fix:
final EjbJarDescription ejbModuleDescription = new EjbJarDescription ( moduleDescription , deploymentUnit . getName ( ) . endsWith ( ".war" ) ) ;