Buggy code:
public class EmbeddedServerFactory { public static final String JBOSS_EMBEDDED_ROOT = "jboss.embedded.root" ; private EmbeddedServerFactory ( ) { } public static StandaloneServer create ( final File jbossHomeDir , final Properties systemProps , final Map < String , String > systemEnv , String ... systemPackages ) throws Throwable { if ( ( jbossHomeDir == null ) || ( ( jbossHomeDir . isDirectory ( ) ) == false ) ) throw new IllegalStateException ( ( "Invalid<seq2seq4repair_space>jboss.home.dir:<seq2seq4repair_space>" + jbossHomeDir ) ) ; if ( ( systemProps . getProperty ( HOME_DIR ) ) == null ) systemProps . setProperty ( HOME_DIR , jbossHomeDir . getAbsolutePath ( ) ) ; EmbeddedServerFactory . setupCleanDirectories ( jbossHomeDir , systemProps ) ; File modulesDir = new File ( ( jbossHomeDir + "//modules" ) ) ; final ModuleLoader moduleLoader = InitialModuleLoaderFactory . getModuleLoader ( modulesDir , systemPackages ) ; ModuleIdentifier logModuleId = ModuleIdentifier . create ( "org.jboss.logmanager" ) ; ModuleClassLoader logModuleClassLoader = moduleLoader . loadModule ( logModuleId ) . getClassLoader ( ) ; ClassLoader ctxClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Thread . currentThread ( ) . setContextClassLoader ( logModuleClassLoader ) ; systemProps . setProperty ( "java.util.logging.manager" , "org.jboss.logmanager.LogManager" ) ; if ( ( LogManager . getLogManager ( ) . getClass ( ) ) == ( LogManager . class ) ) { System . err . println ( ( "WARNING:<seq2seq4repair_space>Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>logmodule<seq2seq4repair_space>" + logModuleId ) ) ; } else { Module . setModuleLogger ( new JDKModuleLogger ( ) ) ; } } finally { Thread . currentThread ( ) . setContextClassLoader ( ctxClassLoader ) ; } final ModuleIdentifier serverModuleId = ModuleIdentifier . create ( "org.jboss.as.server" ) ; final Module serverModule = moduleLoader . loadModule ( serverModuleId ) ; final ModuleClassLoader serverModuleClassLoader = serverModule . getClassLoader ( ) ; StandaloneServer standaloneServer = new StandaloneServer ( ) { private Object serviceContainer ; @ Override public void start ( ) throws ServerStartException { try { Class < ? > serverMainClass = serverModuleClassLoader . loadClass ( Main . class . getName ( ) ) ; Method determineEnvironmentMethod = serverMainClass . getMethod ( "determineEnvironment" , String [ ] . class , Properties . class , Map . class ) ; Object serverEnvironment = determineEnvironmentMethod . invoke ( null , new String [ 0 ] , systemProps , systemEnv ) ; Class < ? > bootstrapFactoryClass = serverModuleClassLoader . loadClass ( Factory . class . getName ( ) ) ; Method newInstanceMethod = bootstrapFactoryClass . getMethod ( "newInstance" ) ; Object bootstrap = newInstanceMethod . invoke ( null ) ; Class < ? > configurationClass = serverModuleClassLoader . loadClass ( Configuration . class . getName ( ) ) ; Constructor < ? > configurationCtor = configurationClass . getConstructor ( ) ; Object configuration = configurationCtor . newInstance ( ) ; Method setServerEnvironmentMethod = configurationClass . getMethod ( "setServerEnvironment" , serverEnvironment . getClass ( ) ) ; setServerEnvironmentMethod . invoke ( configuration , serverEnvironment ) ; Method setModuleLoaderMethod = configurationClass . getMethod ( "setModuleLoader" , ModuleLoader . class ) ; setModuleLoaderMethod . invoke ( configuration , moduleLoader ) ; Class < ? > bootstrapClass = serverModuleClassLoader . loadClass ( Bootstrap . class . getName ( ) ) ; <START_BUG> Method bootstrapStartMethod = bootstrapClass . getMethod ( "start" , configurationClass , List . class ) ; <END_BUG> Object future = bootstrapStartMethod . invoke ( bootstrap , configuration , Collections . < ServiceActivator > emptyList ( ) ) ; Class < ? > asyncFutureClass = serverModuleClassLoader . loadClass ( AsyncFuture . class . getName ( ) ) ; Method getMethod = asyncFutureClass . getMethod ( "get" ) ; serviceContainer = getMethod . invoke ( future ) ; } catch ( RuntimeException rte ) { throw rte ; } catch ( Exception ex ) { throw new ServerStartException ( ex ) ; } } @ Override public void stop ( ) { if ( ( serviceContainer ) != null ) { try { Class < ? > serverContainerClass = serverModuleClassLoader . loadClass ( ServiceContainer . class . getName ( ) ) ; Method shutdownMethod = serverContainerClass . getMethod ( "shutdown" ) ; shutdownMethod . invoke ( serviceContainer ) ; Method awaitTerminationMethod = serverContainerClass . getMethod ( "awaitTermination" ) ; awaitTerminationMethod . invoke ( serviceContainer ) ; } catch ( RuntimeException rte ) { throw rte ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } } ; return standaloneServer ; } static void setupCleanDirectories ( File jbossHomeDir , Properties props ) { } private static File getFileUnderAsRoot ( File jbossHomeDir , Properties props , String propName , String relativeLocation ) { } private static File getTempRoot ( Properties props ) { } private static void validateDirectory ( String property , File file ) { } private static void copyDirectory ( File src , File dest ) { } public static void main ( String [ ] args ) throws Throwable { } }

Fix:
Method bootstrapStartMethod = bootstrapClass . getMethod ( "startup" , configurationClass , List . class ) ;