Buggy code:
public class DefaultEjbClientContextService implements Service < EJBClientContext > { private static final Logger logger = Logger . getLogger ( DefaultEjbClientContextService . class ) ; public static final ServiceName BASE_SERVICE_NAME = JBOSS . append ( "ejb3" , "ejbClientContext" ) ; public static final ServiceName DEFAULT_SERVICE_NAME = DefaultEjbClientContextService . BASE_SERVICE_NAME . append ( "default" ) ; private final InjectedValue < TCCLEJBClientContextSelectorService > tcclEJBClientContextSelector = new InjectedValue < TCCLEJBClientContextSelectorService > ( ) ; private final InjectedValue < LocalEjbReceiver > defaultLocalEJBReceiver = new InjectedValue < LocalEjbReceiver > ( ) ; private volatile EJBClientContext context ; private final boolean lockSelectorOnStart ; public DefaultEjbClientContextService ( final boolean lockEJBClientContextSelectorOnStart ) { } @ Override public synchronized void start ( final StartContext context ) throws StartException { <START_BUG> final EJBClientContext clientContext = EJBClientContext . create ( new DefaultEjbClientContextService . LocalOnlyEjbClientConfiguration ( ) ) ; <END_BUG> final LocalEjbReceiver localEjbReceiver = this . defaultLocalEJBReceiver . getOptionalValue ( ) ; if ( localEjbReceiver != null ) { clientContext . registerEJBReceiver ( localEjbReceiver ) ; } this . context = clientContext ; if ( this . lockSelectorOnStart ) { AccessController . doPrivileged ( new DefaultEjbClientContextService . LockSelectorAction ( ) ) ; } INSTANCE . setup ( this . tcclEJBClientContextSelector . getValue ( ) , this . context ) ; } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public EJBClientContext getValue ( ) throws IllegalArgumentException , IllegalStateException { } public Injector < TCCLEJBClientContextSelectorService > getTCCLBasedEJBClientContextSelectorInjector ( ) { } public Injector < LocalEjbReceiver > getDefaultLocalEJBReceiverInjector ( ) { } private static final class SetSelectorAction implements PrivilegedAction < ContextSelector < EJBClientContext > > { private final ContextSelector < EJBClientContext > selector ; private SetSelectorAction ( final ContextSelector < EJBClientContext > selector ) { } @ Override public ContextSelector < EJBClientContext > run ( ) { } } private static final class LockSelectorAction implements PrivilegedAction < Void > { @ Override public Void run ( ) { } } class LocalOnlyEjbClientConfiguration implements EJBClientConfiguration { private final DeploymentNodeSelector localPreferringDeploymentNodeSelector = new LocalEJBReceiverPreferringDeploymentNodeSelector ( ) ; @ Override public String getEndpointName ( ) { } @ Override public OptionMap getEndpointCreationOptions ( ) { } @ Override public OptionMap getRemoteConnectionProviderCreationOptions ( ) { } @ Override public CallbackHandler getCallbackHandler ( ) { } @ Override public Iterator < RemotingConnectionConfiguration > getConnectionConfigurations ( ) { } @ Override public Iterator < ClusterConfiguration > getClusterConfigurations ( ) { } @ Override public ClusterConfiguration getClusterConfiguration ( String nodeName ) { } @ Override public long getInvocationTimeout ( ) { } @ Override public long getReconnectTasksTimeout ( ) { } @ Override public DeploymentNodeSelector getDeploymentNodeSelector ( ) { } } }

Fix:
final EJBClientContext clientContext = EJBClientContext . create ( new DefaultEjbClientContextService . LocalOnlyEjbClientConfiguration ( ) , this . getClass ( ) . getClassLoader ( ) ) ;