1 Reply Latest reply on Jun 17, 2006 2:54 AM by Nancy Aggarwal

    org.hibernate.SessionException: Session is closed!

    Nancy Aggarwal Newbie

      Hi
      I am doing JNDI BINDING of hibernate sessionfactory and using that sessionFactory instance to create session for my web applciation.
      I am getting exception:Session is closed!

      I searched on net and found its a bug:JBAS-2707 in JBoss Application Server for HibernateIntgUnitTestCase Failure.It has been resolved:

      Affects Version/s: JBossAS-4.0.4RC1, JBossAS-4.0.4.CR2
      Fix Version/s: JBossAS-5.0 Alpha, JBossAS-4.0.4RC1, JBossAS-4.0.4.CR2


      I have downloaded new installer:jboss-4.0.4.GA-Patch1-installer.jar

      But issue is not resolved with that version also...

      Please help...........

      Caused by: org.hibernate.SessionException: Session is closed!
       at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
       at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1610)
       at .................................................


        • 1. Re: org.hibernate.SessionException: Session is closed!
          Nancy Aggarwal Newbie

          hi,

          My application working fine if i am not getting session factory from Jndi.
          Using hibernate.cfg.xml and loading configuration,if i do then there is no problem.
          But now i have jndi bounded hibernate session factory and placed that configuration file and all .hbm.xml and java objects in har archive and that is palced in ear which contains my application war.
          Structure of my ear:

          .har(hibernate jndi bind config.xml,.hbm.xml and business objects)
          .war(application war file)
          .jar(common libraries-it contains all the jars and my applications classes)

          It has been deployed successfully and my web application's first login page is opened.

          No session close is done explicitly....

          please help