Buggy code:
++ i ) { parameters [ i ] = clone ( method . getParameterTypes ( ) [ i ] , parameterCloner , invocation . getParameters ( ) [ i ] , allowPassByReference ) ; } } final InterceptorContext interceptorContext = new InterceptorContext ( ) ; interceptorContext . setParameters ( parameters ) ; interceptorContext . setMethod ( method ) ; interceptorContext . setTarget ( invocation . getInvokedProxy ( ) ) ; final Map < Object , Object > privateAttachments = invocation . getAttachments ( ) ; final Map < String , Object > invocationContextData = invocation . getContextData ( ) ; if ( ( invocationContextData == null ) && ( privateAttachments . isEmpty ( ) ) ) { interceptorContext . setContextData ( new HashMap < String , Object > ( ) ) ; } else { final Map < String , Object > data = new HashMap < String , Object > ( ) ; interceptorContext . setContextData ( data ) ; for ( Map . Entry < String , Object > entry : invocationContextData . entrySet ( ) ) { data . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } if ( ! ( privateAttachments . isEmpty ( ) ) ) { data . put ( PRIVATE_ATTACHMENTS_KEY , privateAttachments ) ; } final boolean txIdAttachmentPresent = privateAttachments . containsKey ( TRANSACTION_ID_KEY ) ; if ( txIdAttachmentPresent ) { data . put ( PRIVATE_DATA_KEY , privateAttachments . get ( TRANSACTION_ID_KEY ) ) ; } } interceptorContext . putPrivateData ( Component . class , ejbComponent ) ; interceptorContext . putPrivateData ( ComponentView . class , view ) ; if ( locator instanceof StatefulEJBLocator ) { final SessionID sessionID = ( ( StatefulEJBLocator ) ( locator ) ) . getSessionId ( ) ; interceptorContext . putPrivateData ( SessionID . class , sessionID ) ; } else if ( locator instanceof EntityEJBLocator ) { final Object primaryKey = ( ( EntityEJBLocator ) ( locator ) ) . getPrimaryKey ( ) ; interceptorContext . putPrivateData ( PRIMARY_KEY_CONTEXT_KEY , primaryKey ) ; } final ClonerConfiguration config = new ClonerConfiguration ( ) ; config . setClassCloner ( new LocalInvocationClassCloner ( invocation . getInvokedProxy ( ) . getClass ( ) . getClassLoader ( ) ) ) ; final ObjectCloner resultCloner = ObjectCloners . getSerializingObjectClonerFactory ( ) . createCloner ( config ) ; if ( async ) { if ( ejbComponent instanceof SessionBeanComponent ) { final SessionBeanComponent component = ( ( SessionBeanComponent ) ( ejbComponent ) ) ; final CancellationFlag flag = new CancellationFlag ( ) ; final SecurityContext securityContext = SecurityContextAssociation . getSecurityContext ( ) ; final AsyncInvocationTask task = new AsyncInvocationTask ( flag ) { @ Override protected Object runInvocation ( ) throws Exception { LocalEjbReceiver . setSecurityContextOnAssociation ( securityContext ) ; try { return view . invoke ( interceptorContext ) ; } finally { LocalEjbReceiver . clearSecurityContextOnAssociation ( ) ; } } } ; interceptorContext . putPrivateData ( CancellationFlag . class , flag ) ; component . getAsynchronousExecutor ( ) . submit ( task ) ; receiverContext . resultReady ( new LocalEjbReceiver . ImmediateResultProducer ( task ) ) ; } else { throw EjbMessages . MESSAGES . asyncInvocationOnlyApplicableForSessionBeans ( ) ; } } else { final Object result ; try { result = view . invoke ( interceptorContext ) ; } catch ( Exception e ) { <START_BUG> throw ( ( Exception ) ( clone ( resultCloner , e ) ) ) ; <END_BUG> } final Object clonedResult = clone ( invocation . getInvokedMethod ( ) . getReturnType ( ) , resultCloner , result , allowPassByReference ) ; receiverContext . resultReady ( new LocalEjbReceiver . ImmediateResultProducer ( clonedResult ) ) ; } } @ Override protected < T > StatefulEJBLocator < T > openSession ( EJBReceiverContext context , Class < T > viewType , String appName , String moduleName , String distinctName , String beanName ) throws IllegalArgumentException { } private Object clone ( final Class < ? > target , final ObjectCloner cloner , final Object object , final boolean allowPassByReference ) { } private Object clone ( final ObjectCloner cloner , final Object object ) { } @ Override protected boolean exists ( final String appName , final String moduleName , final String distinctName , final String beanName ) { } @ Override protected int sendPrepare ( EJBReceiverContext context , TransactionID transactionID ) throws XAException { } @ Override protected void sendCommit ( EJBReceiverContext context , TransactionID transactionID , boolean onePhase ) throws XAException { } @ Override protected void sendRollback ( EJBReceiverContext context , TransactionID transactionID ) throws XAException { } @ Override protected void sendForget ( EJBReceiverContext context , TransactionID transactionID ) throws XAException { } @ Override protected void beforeCompletion ( EJBReceiverContext context , TransactionID transactionID ) { } private EjbDeploymentInformation findBean ( final String appName , final String moduleName , final String distinctName , final String beanName ) { } @ Override public void start ( final StartContext context ) { } @ Override public void stop ( final StopContext context ) { } @ Override public LocalEjbReceiver getValue ( ) throws IllegalArgumentException , IllegalStateException { } public Injector < DeploymentRepository > getDeploymentRepository ( ) { } public Injector < Endpoint > getEndpointInjector ( ) { } public Injector < EJBRemoteConnectorService > getRemoteConnectorServiceInjector ( ) { } @ Override public void registryAdded ( Registry < String , List < ClientMapping > > cluster ) { } @ Override public void registryRemoved ( Registry < String , List < ClientMapping > > registry ) { } @ SuppressWarnings ( "rawtypes" ) public Injector < RegistryCollector > getClusterRegistryCollectorInjector ( ) { } void addClusterNodes ( final String clusterName , final Map < String , List < ClientMapping > > addedNodes ) { } private void addClusterNodes ( final EJBClientContext ejbClientContext , final String clusterName , final Map < String , List < ClientMapping > > addedNodes ) { } private boolean isLocalOnlyEJBClientContext ( final EJBClientContext ejbClientContext ) { }

Fix:
throw ( ( Exception ) ( clone ( Exception . class , resultCloner , e , allowPassByReference ) ) ) ;