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

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web181

  • via Unknown by Steve Pop,
  • via Unknown by Steve Pop,
  • Stack trace

    • 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)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    MattyMatty
    3 times, last one
    johnxflyjohnxfly
    54 times, last one
    bpbhat77bpbhat77
    2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    15 more bugmates