Buggy code:
public final class EjbAnnotationProcessor implements DeploymentUnitProcessor { private static final Logger logger = Logger . getLogger ( EjbAnnotationProcessor . class ) ; private static final DotName STATELESS_ANNOTATION = DotName . createSimple ( Stateless . class . getName ( ) ) ; private static final DotName STATEFUL_ANNOTATION = DotName . createSimple ( Stateful . class . getName ( ) ) ; private static final DotName SINGLETON_ANNOTATION = DotName . createSimple ( Singleton . class . getName ( ) ) ; private static enum SessionBeanType { STATELESS , STATEFUL , SINGLETON ; } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void processSessionBeans ( final DeploymentUnit deploymentUnit , final List < AnnotationInstance > sessionBeanAnnotations , final EjbAnnotationProcessor . SessionBeanType sessionBeanType ) { final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; EjbJarDescription ejbJarDescription = deploymentUnit . getAttachment ( EJB_JAR_DESCRIPTION ) ; if ( ejbJarDescription == null ) { <START_BUG> ejbJarDescription = new EjbJarDescription ( moduleDescription ) ; <END_BUG> deploymentUnit . putAttachment ( EJB_JAR_DESCRIPTION , ejbJarDescription ) ; } final String applicationName = moduleDescription . getApplicationName ( ) ; final ServiceName deploymentUnitServiceName = deploymentUnit . getServiceName ( ) ; for ( final AnnotationInstance sessionBeanAnnotation : sessionBeanAnnotations ) { final AnnotationTarget target = sessionBeanAnnotation . target ( ) ; if ( ! ( target instanceof ClassInfo ) ) { EjbAnnotationProcessor . logger . warn ( ( ( ( ( sessionBeanAnnotation . name ( ) ) + "<seq2seq4repair_space>annotation<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>only<seq2seq4repair_space>on<seq2seq4repair_space>classes.<seq2seq4repair_space>" ) + target ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>class" ) ) ; continue ; } final ClassInfo sessionBeanClassInfo = ( ( ClassInfo ) ( target ) ) ; final String beanClassName = sessionBeanClassInfo . name ( ) . toString ( ) ; final String ejbName = sessionBeanClassInfo . name ( ) . local ( ) ; final AnnotationValue nameValue = sessionBeanAnnotation . value ( "name" ) ; final String beanName = ( ( nameValue == null ) || ( nameValue . asString ( ) . isEmpty ( ) ) ) ? ejbName : nameValue . asString ( ) ; SessionBeanComponentDescription sessionBeanDescription = null ; switch ( sessionBeanType ) { case STATELESS : sessionBeanDescription = new org . jboss . as . ejb3 . component . stateless . StatelessComponentDescription ( beanName , beanClassName , ejbJarDescription , deploymentUnitServiceName ) ; break ; case STATEFUL : sessionBeanDescription = new org . jboss . as . ejb3 . component . stateful . StatefulComponentDescription ( beanName , beanClassName , ejbJarDescription , deploymentUnitServiceName ) ; break ; case SINGLETON : sessionBeanDescription = new org . jboss . as . ejb3 . component . singleton . SingletonComponentDescription ( beanName , beanClassName , ejbJarDescription , deploymentUnitServiceName ) ; break ; default : throw new IllegalArgumentException ( ( "Unknown<seq2seq4repair_space>session<seq2seq4repair_space>bean<seq2seq4repair_space>type:<seq2seq4repair_space>" + sessionBeanType ) ) ; } if ( ( ejbJarDescription . getEEModuleDescription ( ) . getComponentByName ( sessionBeanDescription . getComponentName ( ) ) ) == null ) { ejbJarDescription . getEEModuleDescription ( ) . addComponent ( sessionBeanDescription ) ; } } } @ Override public void undeploy ( DeploymentUnit context ) { } }

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