java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840)

Hibernate JIRA | Steve Pop | 1 decade ago
  1. 0

    The following error occurs when working with proxy classes deployed on JBoss: ERROR [STDERR] java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840) 09:53:18,867 ERROR [STDERR] at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1062) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) 09:53:18,867 ERROR [STDERR] at java.util.HashMap.readObject(HashMap.java:985) 09:53:18,867 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,867 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,867 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,867 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,867 ERROR [STDERR] at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:824) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) 09:53:18,867 ERROR [STDERR] at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78) 09:53:18,867 ERROR [STDERR] at org.jboss.invocation.MarshalledInvocation.getArguments(MarshalledInvocation.java:346) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683) 09:53:18,867 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,882 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,882 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,882 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) 09:53:18,882 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) 09:53:18,882 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,882 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,882 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,882 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148) 09:53:18,882 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) 09:53:18,882 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536) 09:53:18,882 ERROR [LogInterceptor] RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments 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:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331) at org.jboss.ejb.Container.invoke(Container.java:700) 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:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367) 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:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 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:536) The bug is reproduced in the archives attached. 1. Change db2-ds.xml to work with your db 2. Deploy ear in the JBoss 4. run the MainDevice class from the src archive (after generating tables in the DB)

    Hibernate JIRA | 1 decade ago | Steve Pop
    java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840)
  2. 0

    The following error occurs when working with proxy classes deployed on JBoss: ERROR [STDERR] java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840) 09:53:18,867 ERROR [STDERR] at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1062) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) 09:53:18,867 ERROR [STDERR] at java.util.HashMap.readObject(HashMap.java:985) 09:53:18,867 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,867 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,867 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,867 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,867 ERROR [STDERR] at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:824) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271) 09:53:18,867 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) 09:53:18,867 ERROR [STDERR] at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78) 09:53:18,867 ERROR [STDERR] at org.jboss.invocation.MarshalledInvocation.getArguments(MarshalledInvocation.java:346) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683) 09:53:18,867 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72) 09:53:18,867 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331) 09:53:18,882 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,882 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,882 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,882 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) 09:53:18,882 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) 09:53:18,882 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:53:18,882 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:53:18,882 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:53:18,882 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324) 09:53:18,882 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148) 09:53:18,882 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) 09:53:18,882 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) 09:53:18,882 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536) 09:53:18,882 ERROR [LogInterceptor] RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments 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:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331) at org.jboss.ejb.Container.invoke(Container.java:700) 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:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367) 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:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) 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:536) The bug is reproduced in the archives attached. 1. Change db2-ds.xml to work with your db 2. Deploy ear in the JBoss 4. run the MainDevice class from the src archive (after generating tables in the DB)

    Hibernate JIRA | 1 decade ago | Steve Pop
    java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840)
  3. 0

    Spark 1.6.0 throwing classcast exception in Cluster Mode works fine in local mode

    Stack Overflow | 10 months ago | Rahul Shukla
    java.lang.ClassCastException: cannot assign instance of scala.collection.immutable.List$SerializationProxy to field org.apache.spark.rdd.RDD.org$apache$spark$rdd$RDD$$dependencies_ of type scala.collection.Seq in instance of org.apache.spark.rdd.MapPartitionsRDD
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    com.esotericsoftware.kryo.KryoException

    GitHub | 2 years ago | security08
    java.lang.ClassCastException: cannot assign instance of com.cloudera.oryx.lambda.ValueToWritableFunction to field org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.x$335 of type org.apache.spark.api.java.function.PairFunction in instance of org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1
  6. 0

    Serialization for ImmutableMap (and probably others) class fails with circular graphs.

    GitHub | 2 years ago | gissuebot
    java.lang.ClassCastException: cannot assign instance of com.google.common.collect.ImmutableBiMap$SerializedForm to field ImmutableMapSerialization.map of type com.google.common.collect.ImmutableMap in instance of ImmutableMapSerialization
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassCastException

    cannot assign instance of net.sf.hibernate.proxy.SerializableProxy to field com.hibernate.test.persistence.SubnetRightHolder.subnet of type com.hibernate.test.persistence.NetPortalSubnetwork in instance of com.hibernate.test.persistence.SubnetRightHolder 09:53:18,851 ERROR [STDERR] at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1840)

    at java.io.ObjectStreamClass.setObjFieldValues()
  2. Java RT
    ObjectInputStream.readObject
    1. java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1062)
    2. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851)
    3. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    4. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    5. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    6. java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    7. java.util.HashMap.readObject(HashMap.java:985)
    8. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    9. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    10. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    11. java.lang.reflect.Method.invoke(Method.java:324)
    12. java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:824)
    13. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
    14. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    15. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    16. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    17. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    18. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    19. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    20. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    21. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    22. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    23. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    24. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    25. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    26. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    27. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    28. java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
    29. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
    30. java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    30 frames
  3. JBoss Application Server Server
    StatelessSessionContainer$ContainerInterceptor.invoke
    1. org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:78)
    2. org.jboss.invocation.MarshalledInvocation.getArguments(MarshalledInvocation.java:346)
    3. org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
    3 frames
  4. JBoss Application Server Connector
    CachedConnectionInterceptor.invoke
    1. org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
    1 frame
  5. JBoss Application Server Server
    AbstractTxInterceptor.invokeNext
    1. org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
    2. org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
    2 frames