Buggy code:
public class DeploymentScannerService implements Service < DeploymentScanner > { private static final int DEFAULT_INTERVAL = 5000 ; private long interval ; private TimeUnit unit = TimeUnit . MILLISECONDS ; private boolean enabled ; private boolean autoDeployZipped ; private boolean autoDeployExploded ; private Long deploymentTimeout ; private final String relativeTo ; private DeploymentScanner scanner ; private final InjectedValue < String > relativePathValue = new InjectedValue < String > ( ) ; private final InjectedValue < String > pathValue = new InjectedValue < String > ( ) ; private final InjectedValue < ModelController > controllerValue = new InjectedValue < ModelController > ( ) ; private final InjectedValue < ServerDeploymentRepository > deploymentRepositoryValue = new InjectedValue < ServerDeploymentRepository > ( ) ; private final InjectedValue < ContentRepository > contentRepositoryValue = new InjectedValue < ContentRepository > ( ) ; private final InjectedValue < ScheduledExecutorService > scheduledExecutorValue = new InjectedValue < ScheduledExecutorService > ( ) ; public static ServiceName getServiceName ( String repositoryName ) { } public static ServiceController < ? > addService ( final ServiceTarget serviceTarget , final String name , final String relativeTo , final String path , final Integer scanInterval , TimeUnit unit , final Boolean autoDeployZip , final Boolean autoDeployExploded , final Boolean scanEnabled , final Long deploymentTimeout , final List < ServiceController < ? > > newControllers , final ServiceListener < Object > ... listeners ) { final DeploymentScannerService service = new DeploymentScannerService ( relativeTo , scanInterval , unit , autoDeployZip , autoDeployExploded , scanEnabled , deploymentTimeout ) ; final ServiceName serviceName = DeploymentScannerService . getServiceName ( name ) ; final ServiceName pathService = serviceName . append ( "path" ) ; final ServiceName relativePathService = ( relativeTo != null ) ? RelativePathService . pathNameOf ( relativeTo ) : null ; if ( relativeTo != null ) { <START_BUG> RelativePathService . addService ( pathService , path , relativeTo , serviceTarget , newControllers , listeners ) ; <END_BUG> } else { AbsolutePathService . addService ( pathService , path , serviceTarget , newControllers , listeners ) ; } final ThreadFactory threadFactory = new JBossThreadFactory ( new ThreadGroup ( "DeploymentScanner-threads" ) , Boolean . FALSE , null , "%G<seq2seq4repair_space>-<seq2seq4repair_space>%t" , null , null , AccessController . getContext ( ) ) ; final ScheduledExecutorService scheduledExecutorService = Executors . newScheduledThreadPool ( 2 , threadFactory ) ; ServiceBuilder builder = serviceTarget . addService ( serviceName , service ) . addDependency ( pathService , String . class , service . pathValue ) . addDependency ( JBOSS_SERVER_CONTROLLER , ModelController . class , service . controllerValue ) . addDependency ( SERVICE_NAME , ServerDeploymentRepository . class , service . deploymentRepositoryValue ) . addDependency ( ContentRepository . SERVICE_NAME , ContentRepository . class , service . contentRepositoryValue ) . addDependency ( JBOSS_DEPLOYMENT_CHAINS ) . addInjection ( service . scheduledExecutorValue , scheduledExecutorService ) ; if ( relativePathService != null ) { builder . addDependency ( relativePathService , String . class , service . relativePathValue ) ; } builder . addListener ( listeners ) ; ServiceController < ? > svc = builder . setInitialMode ( ACTIVE ) . install ( ) ; if ( newControllers != null ) { newControllers . add ( svc ) ; } return svc ; } DeploymentScannerService ( final String relativeTo , final Integer interval , final TimeUnit unit , final Boolean autoDeployZipped , final Boolean autoDeployExploded , final Boolean enabled , final Long deploymentTimeout ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { } @ Override public synchronized DeploymentScanner getValue ( ) throws IllegalStateException { } }

Fix:
RelativePathService . addService ( pathService , path , false , relativeTo , serviceTarget , newControllers , listeners ) ;