Buggy code:
public class EEJndiViewExtension implements JndiViewExtension , Service < Void > { static final ServiceName SERVICE_NAME = JBOSS . append ( "jndi-view" , "extension" , "ee" ) ; private final InjectedValue < JndiViewExtensionRegistry > registry = new InjectedValue < JndiViewExtensionRegistry > ( ) ; public synchronized void start ( StartContext startContext ) throws StartException { } public synchronized void stop ( StopContext stopContext ) { } public Void getValue ( ) throws IllegalArgumentException , IllegalStateException { } public void execute ( final JndiViewExtensionContext context ) throws OperationFailedException { final ModelNode applicationsNode = context . getResult ( ) . get ( "applications" ) ; final ServiceRegistry serviceRegistry = context . getOperationContext ( ) . getServiceRegistry ( false ) ; <START_BUG> final Set < Resource . ResourceEntry > deploymentResource = context . getOperationContext ( ) . readResourceFromRoot ( EMPTY_ADDRESS ) . getChildren ( DEPLOYMENT ) ; <END_BUG> for ( final Resource . ResourceEntry entry : deploymentResource ) { final ServiceController < ? > deploymentUnitServiceController = serviceRegistry . getService ( JBOSS . append ( "deployment" , "unit" , entry . getName ( ) ) ) ; if ( deploymentUnitServiceController != null ) { final ModelNode deploymentNode = applicationsNode . get ( entry . getName ( ) ) ; final DeploymentUnit deploymentUnit = DeploymentUnit . class . cast ( deploymentUnitServiceController . getValue ( ) ) ; final String appName = cleanName ( deploymentUnit . getName ( ) ) ; final ServiceName appContextName = ContextNames . contextServiceNameOfApplication ( appName ) ; final ServiceController < ? > appContextController = serviceRegistry . getService ( appContextName ) ; if ( appContextController != null ) { final NamingStore appStore = NamingStore . class . cast ( appContextController . getValue ( ) ) ; try { context . addEntries ( deploymentNode . get ( "java:app" ) , new org . jboss . as . naming . NamingContext ( appStore , null ) ) ; } catch ( NamingException e ) { throw new OperationFailedException ( e , new ModelNode ( ) . set ( ROOT_LOGGER . failedToRead ( "java:app" , appName ) ) ) ; } } if ( DeploymentTypeMarker . isType ( EAR , deploymentUnit ) ) { final List < ResourceRoot > roots = deploymentUnit . getAttachmentList ( RESOURCE_ROOTS ) ; if ( roots != null ) for ( ResourceRoot root : roots ) { if ( SubDeploymentMarker . isSubDeployment ( root ) ) { final ResourceRoot parentRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; final String relativePath = root . getRoot ( ) . getPathNameRelativeTo ( parentRoot . getRoot ( ) ) ; final ServiceName subDeploymentServiceName = Services . deploymentUnitName ( deploymentUnit . getName ( ) , relativePath ) ; final ServiceController < ? > subDeploymentController = serviceRegistry . getService ( subDeploymentServiceName ) ; if ( subDeploymentController != null ) { final DeploymentUnit subDeploymentUnit = DeploymentUnit . class . cast ( subDeploymentController . getValue ( ) ) ; handleModule ( context , subDeploymentUnit , deploymentNode . get ( "modules" ) , serviceRegistry ) ; } } } } else { handleModule ( context , deploymentUnit , deploymentNode . get ( "modules" ) , serviceRegistry ) ; } } } } private void handleModule ( final JndiViewExtensionContext context , final DeploymentUnit deploymentUnit , final ModelNode modulesNode , final ServiceRegistry serviceRegistry ) throws OperationFailedException { } private String cleanName ( final String name ) { } public Injector < JndiViewExtensionRegistry > getRegistryInjector ( ) { } }

Fix:
final Set < Resource . ResourceEntry > deploymentResource = context . getOperationContext ( ) . readResourceFromRoot ( EMPTY_ADDRESS , false ) . getChildren ( DEPLOYMENT ) ;