Buggy code:
public class DescriptorBasedEJBClientContextService implements Service < EJBClientContext > { public static final ServiceName BASE_SERVICE_NAME = JBOSS . append ( "ejb3" , "dd-based-ejb-client-context" ) ; private static final Logger logger = Logger . getLogger ( DescriptorBasedEJBClientContextService . class ) ; private static final long DEFAULT_CONNECTION_TIMEOUT = 5000L ; private final Map < ServiceName , InjectedValue < AbstractOutboundConnectionService > > remotingOutboundConnections = new HashMap < ServiceName , InjectedValue < AbstractOutboundConnectionService > > ( ) ; private final InjectedValue < LocalEjbReceiver > localEjbReceiverInjectedValue = new InjectedValue < LocalEjbReceiver > ( ) ; private final EJBClientConfiguration ejbClientConfiguration ; private final ClassLoader clientContextClassloader ; private final Map < String , OptionMap > channelCreationOpts = Collections . synchronizedMap ( new HashMap < String , OptionMap > ( ) ) ; private final Map < String , Long > connectionTimeouts = Collections . synchronizedMap ( new HashMap < String , Long > ( ) ) ; private volatile EJBClientContext ejbClientContext ; @ Deprecated public DescriptorBasedEJBClientContextService ( final EJBClientConfiguration ejbClientConfiguration ) { } public DescriptorBasedEJBClientContextService ( final EJBClientConfiguration ejbClientConfiguration , final ClassLoader clientContextClassloader ) { } @ Override public synchronized void start ( StartContext startContext ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { final LocalEjbReceiver localEjbReceiver = this . localEjbReceiverInjectedValue . getOptionalValue ( ) ; if ( localEjbReceiver != null ) { <START_BUG> localEjbReceiver . stop ( context ) ; <END_BUG> DescriptorBasedEJBClientContextService . logger . debugf ( "Removed<seq2seq4repair_space>a<seq2seq4repair_space>local<seq2seq4repair_space>EJB<seq2seq4repair_space>receiver<seq2seq4repair_space>from<seq2seq4repair_space>descriptor<seq2seq4repair_space>based<seq2seq4repair_space>EJB<seq2seq4repair_space>client<seq2seq4repair_space>context<seq2seq4repair_space>named<seq2seq4repair_space>%s" , context . getController ( ) . getName ( ) ) ; } if ( ( this . ejbClientContext ) != null ) { IoUtils . safeClose ( this . ejbClientContext ) ; } this . ejbClientContext = null ; } @ Override public EJBClientContext getValue ( ) throws IllegalArgumentException , IllegalStateException { } public void addRemotingConnectionDependency ( final ServiceBuilder < EJBClientContext > serviceBuilder , final ServiceName serviceName ) { } public void setChannelCreationOptions ( final String outboundConnectionName , final OptionMap options ) { } public void setConnectionCreationTimeout ( final String outboundConnectionName , final long timeoutInMillis ) { } public Injector < LocalEjbReceiver > getLocalEjbReceiverInjector ( ) { } private void registerRemotingEJBReceivers ( final StartContext startContext , final EJBClientContext context ) { } private class OutboundConnectionReconnectHandler implements ReconnectHandler { private final ServiceRegistry serviceRegistry ; private final ServiceName outboundConnectionServiceName ; private final EJBClientContext clientContext ; private volatile int reconnectAttemptCount ; private final long connectionTimeout ; private final OptionMap channelCreationOpts ; OutboundConnectionReconnectHandler ( final ServiceRegistry serviceRegistry , final ServiceName outboundConnectionServiceName , final EJBClientContext clientContext , final long connectionTimeout , final OptionMap channelCreationOpts ) { } @ Override public void reconnect ( ) throws IOException { } } }

Fix:
this . ejbClientContext . unregisterEJBReceiver ( localEjbReceiver ) ;