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

Hibernate JIRA | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 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
  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

    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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.InvalidObjectException

      Could not find a SessionFactory named: sessionFactory

      at net.sf.hibernate.impl.SessionFactoryImpl.readResolve()
    2. net.sf.hibernate
      SessionFactoryImpl.readResolve
      1. net.sf.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:399)
      1 frame
    3. Java RT
      ObjectInputStream.defaultReadObject
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.io.ObjectStreamClass.invokeMethod(ObjectStreamClass.java:1610)
      3. java.io.ObjectInputStream.readObject(ObjectInputStream.java:388)
      4. java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
      5. java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
      5 frames
    4. net.sf.hibernate
      SessionImpl.readObject
      1. net.sf.hibernate.impl.SessionImpl.readObject(SessionImpl.java:460)
      1 frame
    5. Java RT
      ObjectInputStream.readObject
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
      3. java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
      4. java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
      5. java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
      6. java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
      7. java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
      8. java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
      9. java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
      10. java.util.ArrayList.readObject(ArrayList.java:526)
      11. java.lang.reflect.Method.invoke(Native Method)
      12. java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2209)
      13. java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1406)
      14. java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
      15. java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
      16. java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
      17. java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
      18. java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
      19. java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
      20. java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
      21. java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
      22. java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
      23. java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
      23 frames
    6. Atmosphere weblogic
      AttributeWrapper.getObject
      1. weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:104)
      2. weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:66)
      2 frames
    7. weblogic.servlet.internal
      SessionContext$InvalidationAction.run
      1. weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:603)
      2. weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:585)
      3. weblogic.servlet.internal.session.SessionData.remove(SessionData.java:767)
      4. weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySessionContext.java:61)
      5. weblogic.servlet.internal.session.SessionContext$InvalidationAction.run(SessionContext.java:536)
      5 frames
    8. weblogic.security.service
      SecurityServiceManager.runAs
      1. weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
      1 frame
    9. weblogic.servlet.internal
      SessionContext$SessionInvalidator.trigger
      1. weblogic.servlet.internal.session.SessionContext$SessionInvalidator.cleanupExpiredSessions(SessionContext.java:456)
      2. weblogic.servlet.internal.session.SessionContext.deleteInvalidSessions(SessionContext.java:83)
      3. weblogic.servlet.internal.session.SessionContext$SessionInvalidator.trigger(SessionContext.java:404)
      3 frames
    10. weblogic.time.common
      ScheduledTrigger.run
      1. weblogic.time.common.internal.ScheduledTrigger.run(ScheduledTrigger.java:181)
      1 frame
    11. weblogic.security.service
      SecurityServiceManager.runAs
      1. weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
      1 frame
    12. weblogic.time.common
      ScheduledTrigger.execute
      1. weblogic.time.common.internal.ScheduledTrigger.executeLocally(ScheduledTrigger.java:167)
      2. weblogic.time.common.internal.ScheduledTrigger.execute(ScheduledTrigger.java:161)
      2 frames
    13. weblogic.time.server
      ScheduledTrigger.execute
      1. weblogic.time.server.ScheduledTrigger.execute(ScheduledTrigger.java:39)
      1 frame
    14. weblogic.kernel
      ExecuteThread.run
      1. weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
      2. weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
      2 frames