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

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

    1. extract the zip file 2. change db passwd in db2-ds.xml and hibernate.properties 3. copy jbossmq-proxy-destinations-service.xml in ${JBOSS_HOME}/server/default/deploy/jms 4. run ant to build ear file 5. deploy EAR 6. run MainDevice Result: drop table netportalgroup drop table subnet drop table subnetrightholder drop table network create table netportalgroup ( id BIGINT not null generated by default as identity, name VARCHAR(255) not null unique, expiration_date DATE, max_no_sim_sess INTEGER not null, max_no_sess INTEGER not null, primary key (id) ) create table subnet ( id BIGINT not null generated by default as identity, net_subnet_id BIGINT, primary key (id) ) create table subnetrightholder ( id BIGINT not null generated by default as identity, access_state SMALLINT not null, subnet_gr_id BIGINT, subnet BIGINT, primary key (id) ) create table network ( id BIGINT not null generated by default as identity, description VARCHAR(255), globalVlanId SMALLINT, primary key (id) ) alter table subnet add constraint FKCADC435DBA89991B foreign key (net_subnet_id) references network alter table subnetrightholder add constraint FK68887B4BCADC435D foreign key (subnet) references subnet alter table subnetrightholder add constraint FK68887B4B56FEA58D foreign key (subnet_gr_id) references netportalgroup group added group retrieved 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 at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1885) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1076) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at java.util.HashMap.readObject(HashMap.java:1005) 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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:103) at com.diatem.message.api.MsgListener.onMessage(MsgListener.java:18) at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:546) at java.lang.Thread.run(Thread.java:534) Exception in listener: 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 group updated

    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
  2. 0

    1. extract the zip file 2. change db passwd in db2-ds.xml and hibernate.properties 3. copy jbossmq-proxy-destinations-service.xml in ${JBOSS_HOME}/server/default/deploy/jms 4. run ant to build ear file 5. deploy EAR 6. run MainDevice Result: drop table netportalgroup drop table subnet drop table subnetrightholder drop table network create table netportalgroup ( id BIGINT not null generated by default as identity, name VARCHAR(255) not null unique, expiration_date DATE, max_no_sim_sess INTEGER not null, max_no_sess INTEGER not null, primary key (id) ) create table subnet ( id BIGINT not null generated by default as identity, net_subnet_id BIGINT, primary key (id) ) create table subnetrightholder ( id BIGINT not null generated by default as identity, access_state SMALLINT not null, subnet_gr_id BIGINT, subnet BIGINT, primary key (id) ) create table network ( id BIGINT not null generated by default as identity, description VARCHAR(255), globalVlanId SMALLINT, primary key (id) ) alter table subnet add constraint FKCADC435DBA89991B foreign key (net_subnet_id) references network alter table subnetrightholder add constraint FK68887B4BCADC435D foreign key (subnet) references subnet alter table subnetrightholder add constraint FK68887B4B56FEA58D foreign key (subnet_gr_id) references netportalgroup group added group retrieved 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 at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1885) at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1076) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at java.util.HashMap.readObject(HashMap.java:1005) 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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:103) at com.diatem.message.api.MsgListener.onMessage(MsgListener.java:18) at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:546) at java.lang.Thread.run(Thread.java:534) Exception in listener: 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 group updated

    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
  3. 0

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

    Stack Overflow | 9 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

  1. bpbhat77 2 times, last 4 months ago
  2. shiva768 1 times, last 11 months ago
11 unregistered visitors
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

    at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues()
  2. Java RT
    ObjectInputStream.readObject
    1. java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1885)
    2. java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1076)
    3. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1851)
    4. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    5. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    6. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    7. java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    8. java.util.HashMap.readObject(HashMap.java:1005)
    9. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    11. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    12. java.lang.reflect.Method.invoke(Method.java:324)
    13. java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
    14. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
    15. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    16. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    17. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    18. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    19. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    20. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    21. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    22. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    23. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    24. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    25. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    26. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    27. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    28. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    29. java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    29 frames
  3. JBossMQ
    SpyObjectMessage.getObject
    1. org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:103)
    1 frame
  4. com.diatem.message
    MsgListener.onMessage
    1. com.diatem.message.api.MsgListener.onMessage(MsgListener.java:18)
    1 frame
  5. JBossMQ
    SpyMessageConsumer.run
    1. org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:546)
    1 frame
  6. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:534)
    1 frame