java.lang.IllegalArgumentException: java.io.InvalidObjectException: Could not find a SessionFactory [uuid=533b12b1-0e56-4761-bf18-71237dc6efcc,name=null]

Terracotta | mhaller | 4 years ago
  1. 0

    TimeoutException and JGroupsBootstrapManager warnings

    Terracotta | 4 years ago | mhaller
    java.lang.IllegalArgumentException: java.io.InvalidObjectException: Could not find a SessionFactory [uuid=533b12b1-0e56-4761-bf18-71237dc6efcc,name=null]
  2. 0

    Clustering with Hibernate: SEVERE: IOException while loading persisted sessions: java.io.InvalidObjectException: Could not find a SessionFactory

    Stack Overflow | 3 years ago | swarmer
    java.io.InvalidObjectException: Could not find a SessionFactory [uuid=158c1e24-039b-4406-9a9b-cebb836100d1,name=null]
  3. 0

    It seems that when using composite-id for a class (EmbeddedComponentType), the session factory is serialized together with data read from the database. This causes a problem when the data is transported from an application server to a client, as the session factory cannot (and shouldn't) be restored on the client. The result is an InvalidObjectException, see below. The attached test case recreates the problem by reading instances from the database and storing them in serialized form. Another test method reads the serialized data, and fails with an InvalidObjectException. Two separate test runs are needed (one for writing the serialized data, and one for reading), to ensure that the previously used session factory isn't available when reading the serialized data. The class MyOrder uses a composite-id, and is one-to-many associated with the OrderLine class which is the one loaded from the database in the test case. With older versions of Hibernate (like 3.5.5) the test passes, probably because old versions was able to restore the session factory on the client. {code} java.io.InvalidObjectException: Could not find a SessionFactory [uuid=12758cfe-1277-43aa-b784-bac5915b3486,name=null] at org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:1781) at org.hibernate.internal.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:1761) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1807) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at java.util.ArrayList.readObject(ArrayList.java:771) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at y.domain.TestOrderLine.testRead(TestOrderLine.java:29) {code}

    Hibernate JIRA | 3 years ago | Olav Mork Bjørnås
    java.io.InvalidObjectException: Could not find a SessionFactory [uuid=12758cfe-1277-43aa-b784-bac5915b3486,name=null]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    It seems that when using composite-id for a class (EmbeddedComponentType), the session factory is serialized together with data read from the database. This causes a problem when the data is transported from an application server to a client, as the session factory cannot (and shouldn't) be restored on the client. The result is an InvalidObjectException, see below. The attached test case recreates the problem by reading instances from the database and storing them in serialized form. Another test method reads the serialized data, and fails with an InvalidObjectException. Two separate test runs are needed (one for writing the serialized data, and one for reading), to ensure that the previously used session factory isn't available when reading the serialized data. The class MyOrder uses a composite-id, and is one-to-many associated with the OrderLine class which is the one loaded from the database in the test case. With older versions of Hibernate (like 3.5.5) the test passes, probably because old versions was able to restore the session factory on the client. {code} java.io.InvalidObjectException: Could not find a SessionFactory [uuid=12758cfe-1277-43aa-b784-bac5915b3486,name=null] at org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:1781) at org.hibernate.internal.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:1761) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1807) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at java.util.ArrayList.readObject(ArrayList.java:771) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at y.domain.TestOrderLine.testRead(TestOrderLine.java:29) {code}

    Hibernate JIRA | 3 years ago | Olav Mork Bjørnås
    java.io.InvalidObjectException: Could not find a SessionFactory [uuid=12758cfe-1277-43aa-b784-bac5915b3486,name=null]
  6. 0

    Infinispan marshalling error for Hibernate entity with composite primary key

    Stack Overflow | 2 years ago | Nathan
    java.io.InvalidObjectException: Could not find a SessionFactory [uuid=0d0cdf26-dfe6-4285-9725-dfaa4821ecba,name=null]

    1 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.io.InvalidObjectException

      Could not find a SessionFactory [uuid=533b12b1-0e56-4761-bf18-71237dc6efcc,name=null]

      at org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization()
    2. Hibernate
      SessionFactoryImpl.readResolve
      1. org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:1992)
      2. org.hibernate.internal.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:1972)
      2 frames
    3. Java RT
      ObjectInputStream.readObject
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      5. java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1091)
      6. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1780)
      7. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      8. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
      9. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
      10. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      11. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      12. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
      13. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
      14. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      15. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      16. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
      17. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
      18. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      19. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      20. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
      21. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
      22. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      23. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      24. java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
      25. java.util.ArrayList.readObject(ArrayList.java:733)
      26. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      27. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      28. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      29. java.lang.reflect.Method.invoke(Method.java:601)
      30. java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004)
      31. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866)
      32. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
      33. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
      34. java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
      34 frames
    4. JGroups
      Message.getObject
      1. org.jgroups.util.Util.objectFromByteBuffer(Util.java:430)
      2. org.jgroups.Message.getObject(Message.java:375)
      2 frames
    5. Hibernate
      SessionFactoryImpl.readResolve
      1. org.hibernate.internal.SessionFactoryImpl.locateSessionFactoryOnDeserialization(SessionFactoryImpl.java:1992)
      2. org.hibernate.internal.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:1972)
      2 frames
    6. Java RT
      Thread.run
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      4. java.lang.Thread.run(Thread.java:722)
      4 frames