2 Replies Latest reply on Feb 23, 2016 6:29 AM by olivier92

    IllegalArgumentException during Serialization

    olivier92 Newbie

      Hi all,

       

      We got this exception during Serialization of an object returned by one of our EJB:

      20:58:54,683 ERROR [org.quartz.core.ErrorLogger] (projectScheduler_Worker-1) Job (DEFAULT.FXPos threw an exception.: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: javax.ejb.EJBTransactionRolledbackException: WFLYEJB0054: Failed to marshal EJB parameters]
       at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: javax.ejb.EJBTransactionRolledbackException: WFLYEJB0054: Failed to marshal EJB parameters
       at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159)
       at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
       at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
       at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:44)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
       at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
       at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
       at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
       at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
       at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:259)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:184)
       at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocation(EJBObjectInterceptor.java:58)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocation(EJBHomeInterceptor.java:83)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:138)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)
       at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)
       at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)
       at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
       at com.sun.proxy.$Proxy71.calculatePosition(Unknown Source)
       at com.project.core.position.PositionBusinessDelegate.calculatePosition(PositionBusinessDelegate.java:75)
       at com.project.core.batch.jobs.PositionCalculationJob.executeprojectJob(PositionCalculationJob.java:32)
       at com.project.core.batch.projectJob.executeInternal(projectJob.java:84)
       at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       ... 1 more
      Caused by: java.lang.RuntimeException: WFLYEJB0054: Failed to marshal EJB parameters
       at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:331)
       at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:311)
       at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:268)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:184)
       at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocation(EJBObjectInterceptor.java:58)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocation(EJBHomeInterceptor.java:83)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:138)
       at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
       at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)
       at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)
       at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)
       at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
       at com.sun.proxy.$Proxy74.getTrades(Unknown Source)
       at com.project.core.trade.TradeBusinessDelegate.getTrades(TradeBusinessDelegate.java:43)
       at com.project.service.position.PositionServiceBean.calculatePosition(PositionServiceBean.java:59)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
       at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
       at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
       at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
       at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
       at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
       at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
       at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
       at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254)
       ... 53 more
      Caused by: java.lang.IllegalArgumentException: Can not set com.project.core.book.Book field com.project.core.trade.Trade.book to com.project.core.book.Book
       at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
       at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
       at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
       at java.lang.reflect.Field.set(Field.java:764)
       at org.jboss.marshalling.cloner.SerializingCloner.storeFields(SerializingCloner.java:414)
       at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:313)
       at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:276)
       at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:276)
       at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:251)
       at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:128)
       at org.jboss.marshalling.cloner.SerializingCloner$StepObjectInput.doReadObject(SerializingCloner.java:882)
       at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
       at org.jboss.marshalling.MarshallerObjectInputStream.readObjectOverride(MarshallerObjectInputStream.java:53)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
       at java.util.HashSet.readObject(HashSet.java:333)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.jboss.marshalling.reflect.SerializableClass.callReadObject(SerializableClass.java:307)
       at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:303)
       at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:251)
       at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:128)
       at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:328)
       ... 100 more
       

      But we don't understand because the objects involved in this error are Serializable. In addition, we already used them as return type of other EJB services without problem.


      We also tried to see if there was a classloading issue but didn't find what could be the problem. the communication is between two applications within the same WildFly instance, each of these applications has a "core" jar in its /lib folder containing the classes com.project.core.book.Book and com.project.core.trade.Trade. The classes are in the same version on both sides.

       

      Does someone know what could happen ? thanks a lot for your help.

      Kind regards

       

      Server: WildFly 10.0.0.Final
      JDK: 1.8.0 update 51
      JBoss Marshalling: 1.4.10.Final