java.io.InvalidObjectException: Could not find a SessionFactory named: null

Hibernate JIRA | TURIN ACCOUNT | 1 decade ago
  1. 0

    When Tomcat reloads an app context, the SessionFactory and its Sessions are loaded from the HttpSession files. I thought this would be fixed with the "null" in the UUIDGenerator fix, but it still throws an Exception on context restart. Everything else works fine, so no showstopper. StandardManager[]: Seeding random number generator class java.security.SecureRandom StandardManager[]: Seeding of random number generator has been completed APP - WARN - SessionFactoryObjectFactory - Not found: ff808081f64e8ea500f64e8ea78e0000 APP - WARN - SessionFactoryObjectFactory - Not found: null StandardManager[] IOException while loading persisted sessions: java.io.InvalidObjectException: Could not find a SessionFactory named: null java.io.InvalidObjectException: Could not find a SessionFactory named: null at net.sf.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:526) 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.invokeReadResolve(ObjectStreamClass.java:911) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452) at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:348) 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:824) 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.readObject(ObjectInputStream.java:324) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864) at org.apache.catalina.session.StandardManager.load(StandardManager.java:440) at org.apache.catalina.session.StandardManager.start(StandardManager.java:655) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2572) at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369) at java.lang.Thread.run(Thread.java:536)

    Hibernate JIRA | 1 decade ago | TURIN ACCOUNT
    java.io.InvalidObjectException: Could not find a SessionFactory named: null
  2. 0

    When Tomcat reloads an app context, the SessionFactory and its Sessions are loaded from the HttpSession files. I thought this would be fixed with the "null" in the UUIDGenerator fix, but it still throws an Exception on context restart. Everything else works fine, so no showstopper. StandardManager[]: Seeding random number generator class java.security.SecureRandom StandardManager[]: Seeding of random number generator has been completed APP - WARN - SessionFactoryObjectFactory - Not found: ff808081f64e8ea500f64e8ea78e0000 APP - WARN - SessionFactoryObjectFactory - Not found: null StandardManager[] IOException while loading persisted sessions: java.io.InvalidObjectException: Could not find a SessionFactory named: null java.io.InvalidObjectException: Could not find a SessionFactory named: null at net.sf.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:526) 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.invokeReadResolve(ObjectStreamClass.java:911) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452) at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:348) 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:824) 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.readObject(ObjectInputStream.java:324) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864) at org.apache.catalina.session.StandardManager.load(StandardManager.java:440) at org.apache.catalina.session.StandardManager.start(StandardManager.java:655) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2572) at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369) at java.lang.Thread.run(Thread.java:536)

    Hibernate JIRA | 1 decade ago | TURIN ACCOUNT
    java.io.InvalidObjectException: Could not find a SessionFactory named: null
  3. 0

    Hi, I have an application that is working fine. In order to be more productive I am trying to use the hot-deployment feature for the first time. My app. server is BEA weblogic 7.0 and I use Hibernate2.13. Problem: When I hot-deploy I get the exception detailed below. I am new to this forum any pointers or help is greatly appreciated. TIA. -Nagaraj ----Exception during Hot-Deployment------------------ [java] <Jul 7, 2004 10:17:52 AM CDT> <Error> <HTTP Session> <100028> <Could not deserialize ses sion data [java] java.io.InvalidObjectException: Could not find a SessionFactory named: sessionFactory [java] at net.sf.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:399) [java] at java.lang.reflect.Method.invoke(Native Method) [java] at java.io.ObjectStreamClass.invokeMethod(ObjectStreamClass.java:1610) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:388) [java] at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258) [java] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514) [java] at net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:460) [java] at java.lang.reflect.Method.invoke(Native Method) [java] at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209) [java] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381) [java] at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258) [java] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514) [java] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231) [java] at java.util.ArrayList.readObject(ArrayList.java:526) [java] at java.lang.reflect.Method.invoke(Native Method) [java] at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209) [java] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381) [java] at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258) [java] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514) [java] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381) [java] at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258) [java] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514) [java] at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381) [java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231) [java] at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:104) [java] at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:66) [java] at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:60 3) [java] at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:58 5) [java] at weblogic.servlet.internal.session.SessionData.remove(SessionData.java:767) [java] at weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySe ssionContext.java:61) [java] at weblogic.servlet.internal.session.SessionContext$InvalidationAction.run(SessionCo ntext.java:536) [java] at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.jav a:685) [java] at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.cleanupExpire dSessions(SessionContext.java:456) [java] at weblogic.servlet.internal.session.SessionContext.deleteInvalidSessions(SessionCon text.java:83) [java] at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.trigger(Sessi onContext.java:404) [java] at weblogic.time.common.internal.ScheduledTrigger.run(ScheduledTrigger.java:181) [java] at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.jav a:685) [java] at weblogic.time.common.internal.ScheduledTrigger.executeLocally(ScheduledTrigger.ja va:167) [java] at weblogic.time.common.internal.ScheduledTrigger.execute(ScheduledTrigger.java:161) [java] at weblogic.time.server.ScheduledTrigger.execute(ScheduledTrigger.java:39) [java] at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234) [java] at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210) [java] >

    Hibernate JIRA | 1 decade ago
    java.io.InvalidObjectException: Could not find a SessionFactory named: sessionFactory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Exception when retrieving job after the server crash

    Terracotta | 6 years ago | paliwal2
    java.io.InvalidObjectException: Could not find a SessionFactory named: null]
  6. 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]

    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 named: null

      at net.sf.hibernate.impl.SessionFactoryImpl.readResolve()
    2. net.sf.hibernate
      SessionFactoryImpl.readResolve
      1. net.sf.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:526)
      1 frame
    3. Java RT
      ObjectInputStream.defaultReadObject
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      5. java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:911)
      6. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655)
      7. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      8. java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      9. java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
      9 frames
    4. net.sf.hibernate
      SessionImpl.readObject
      1. net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:348)
      1 frame
    5. Java RT
      ObjectInputStream.readObject
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      5. java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:824)
      6. java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
      7. java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      8. java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      9. java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      9 frames
    6. Glassfish Core
      WebappLoader$WebappContextNotifier.run
      1. org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1369)
      2. org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:864)
      3. org.apache.catalina.session.StandardManager.load(StandardManager.java:440)
      4. org.apache.catalina.session.StandardManager.start(StandardManager.java:655)
      5. org.apache.catalina.core.StandardContext.reload(StandardContext.java:2572)
      6. org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369)
      6 frames
    7. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:536)
      1 frame