Buggy code:
class EJB3SubsystemAdd extends AbstractBoottimeAddStepHandler { static final EJB3SubsystemAdd INSTANCE = new EJB3SubsystemAdd ( ) ; private EJB3SubsystemAdd ( ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performBoottime ( final OperationContext context , ModelNode operation , final ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { DelegatingStubFactoryFactory . setOverriddenDynamicFactory ( new DynamicStubFactoryFactory ( ) ) ; final RemoteObjectSubstitutionService substitutionService = new RemoteObjectSubstitutionService ( ) ; newControllers . add ( context . getServiceTarget ( ) . addService ( SERVICE_NAME , substitutionService ) . addDependency ( DeploymentRepository . SERVICE_NAME , DeploymentRepository . class , substitutionService . getDeploymentRepositoryInjectedValue ( ) ) . install ( ) ) ; RemoteObjectSubstitutionManager . setRemoteObjectSubstitution ( substitutionService ) ; EjbNamingContextSetup . setupEjbNamespace ( ) ; InitialContext . addUrlContextFactory ( "ejb" , new org . jboss . ejb . client . naming . ejb . ejbURLContextFactory ( ) ) ; final boolean appclient = ( context . getProcessType ( ) ) == ( ProcessType . APPLICATION_CLIENT ) ; final ModelNode defaultDistinctName = DEFAULT_DISTINCT_NAME . resolveModelAttribute ( context , model ) ; final DefaultDistinctNameService defaultDistinctNameService = new DefaultDistinctNameService ( ( defaultDistinctName . isDefined ( ) ? defaultDistinctName . asString ( ) : null ) ) ; newControllers . add ( context . getServiceTarget ( ) . addService ( DefaultDistinctNameService . SERVICE_NAME , defaultDistinctNameService ) . install ( ) ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { @ Override protected void execute ( DeploymentProcessorTarget processorTarget ) { <START_BUG> processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , STRUCTURE , STRUCTURE_REGISTER_JBOSS_XML_PARSER , new org . jboss . as . server . deployment . jbossallxml . JBossAllXmlParserRegisteringProcessor < org . jboss . metadata . ejb . spec . EjbJarMetaData > ( EjbJarJBossAllParser . ROOT_ELEMENT , EjbJarJBossAllParser . ATTACHMENT_KEY , new EjbJarJBossAllParser ( ) ) ) ; <END_BUG> processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_DEFAULT_DISTINCT_NAME , new org . jboss . as . ejb3 . deployment . processors . EjbDefaultDistinctNameProcessor ( defaultDistinctNameService ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_CONTEXT_BINDING , new EjbContextJndiBindingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_DEPLOYMENT , new EjbJarParsingDeploymentUnitProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_CREATE_COMPONENT_DESCRIPTIONS , new AnnotatedEJBComponentDescriptionDeploymentUnitProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_SESSION_BEAN_DD , new SessionBeanXmlDescriptorProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_ANNOTATION_EJB , new EjbAnnotationProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_INJECTION_ANNOTATION , new EjbResourceInjectionAnnotationProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_ENTITY_BEAN_CREATE_COMPONENT_DESCRIPTIONS , new EntityBeanComponentDescriptionFactory ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_ASSEMBLY_DESC_DD , new AssemblyDescriptorProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , DEPENDENCIES , DEPENDENCIES_EJB , new EjbDependencyDeploymentUnitProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_HOME_MERGE , new HomeViewMergingProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_REF , new EjbRefProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_BUSINESS_VIEW_ANNOTATION , new BusinessViewAnnotationProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_ORB_BIND , new IIOPJndiBindingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_JNDI_BINDINGS , new EjbJndiBindingsDeploymentUnitProcessor ( appclient ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_CLIENT_METADATA , new EJBClientDescriptorMetaDataProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , INSTALL , INSTALL_EJB_CLIENT_CONTEXT , new EjbClientContextSetupProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , INSTALL , INSTALL_EJB_JACC_PROCESSING , new JaccEjbDeploymentProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , CLEANUP , CLEANUP_EJB , new EjbCleanUpProcessor ( ) ) ; if ( ! appclient ) { processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_TIMERSERVICE_BINDING , new TimerServiceJndiBindingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_APPLICATION_EXCEPTION_ANNOTATION , new ApplicationExceptionAnnotationProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_DD_INTERCEPTORS , new InterceptorClassDeploymentDescriptorProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_EJB_SECURITY_ROLE_REF_DD , new SecurityRoleRefDDProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , PARSE , PARSE_PASSIVATION_ANNOTATION , new PassivationAnnotationParsingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_IMPLICIT_NO_INTERFACE_VIEW , new ImplicitLocalViewProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_APPLICATION_EXCEPTIONS , new ApplicationExceptionMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_DD_INTERCEPTORS , new DeploymentDescriptorInterceptorBindingsProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_DD_METHOD_RESOLUTION , new DeploymentDescriptorMethodProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_TRANSACTION_MANAGEMENT , new TransactionManagementMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_CONCURRENCY_MANAGEMENT_MERGE , new ConcurrencyManagementMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_CONCURRENCY_MERGE , new EjbConcurrencyMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_TX_ATTR_MERGE , new TransactionAttributeMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_RUN_AS_MERGE , new RunAsMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_RESOURCE_ADAPTER_MERGE , new ResourceAdaptorMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_REMOVE_METHOD , new RemoveMethodMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_STARTUP_MERGE , new StartupMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_SECURITY_DOMAIN , new SecurityDomainMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_ROLES , new DeclareRolesMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_METHOD_PERMISSIONS , new MethodPermissionsMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_STATEFUL_TIMEOUT , new StatefulTimeoutMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , POST_MODULE , POST_MODULE_EJB_SESSION_SYNCHRONIZATION , new SessionSynchronizationMergingProcessor ( ) ) ;

Fix:
processorTarget . addDeploymentProcessor ( SUBSYSTEM_NAME , STRUCTURE , STRUCTURE_REGISTER_JBOSS_ALL_XML_PARSER , new org . jboss . as . server . deployment . jbossallxml . JBossAllXmlParserRegisteringProcessor < org . jboss . metadata . ejb . spec . EjbJarMetaData > ( EjbJarJBossAllParser . ROOT_ELEMENT , EjbJarJBossAllParser . ATTACHMENT_KEY , new EjbJarJBossAllParser ( ) ) ) ;