0 Replies Latest reply on Jul 28, 2006 3:58 PM by Felix Mayer

    IllegalArgumentException during deserialization

    Felix Mayer Newbie

      Under specific circumstances I get the exception below when making a call to an EJB3 stateless session bean using JBoss 4.0.4.GA-Patch1. I debugged JBoss and found that the object passed to java.lang.reflect.Method.invoke() was not of the correct class; the method is readResolve(). The circumstances are as follows:

      - The bean's remote interface must be looked up from inside of the JBoss EJB container. If we use the local interface inside of the container or the remote interface from outside, everything is fine.

      - The deserialized graph must contain a org.geotools.referencing.crs.DefaultProjectedCRS, which contains a bunch of other Geotools objects.

      This behavior is reproducible 100% of the time.
      If necessary, I should be able to provide a standalone test case.

      java.lang.IllegalArgumentException: object is not an instance of declaring class
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:426)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
      at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
      at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
      at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
      at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
      at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
      at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
      at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
      at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
      at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:841)
      at org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      at $Proxy150.createCoordinateReferenceSystem(Unknown Source)
      at com.lggi.esp.services.ejb.spatial.core.coordinatesystem.CoordinateSystemWorker.createCoordinateReferenceSystem_aroundBody10(CoordinateSystemWorker.java:120)
      at com.lggi.esp.services.ejb.spatial.core.coordinatesystem.CoordinateSystemWorker$AjcClosure11.run(CoordinateSystemWorker.java:1)
      at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:101)
      at com.lggi.esp.services.aspects.security.SecurityAspect.aroundSecuredMethods(SecurityAspect.aj:104)
      at com.lggi.esp.services.ejb.spatial.core.coordinatesystem.CoordinateSystemWorker.createCoordinateReferenceSystem(CoordinateSystemWorker.java:1)
      at com.lggi.esp.services.ejb.spatial.core.coordinatesystem.CoordinateSystemBean.createCoordinateReferenceSystem(CoordinateSystemBean.java:94)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
      at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
      at org.jboss.ejb.Container.invoke(Container.java:954)
      at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
      at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:595)