Uploaded image for project: 'Hibernate Integration'
  1. Hibernate Integration
  2. HIBERNATE-4

NPE in HibernateContext.prepareSession

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Rejected
    • Labels:
      None

      Description

      SourceForge Submitter: pilhuhn .
      Hi,
      this might be a pilot error ...

      When I try to obtain a session like this:

      Session =
      HibernateContext.getSession("java:/hibernate/SessionFactory");

      I get a NPE

      Caused by: java.lang.NullPointerException
      at
      org.jboss.hibernate.session.HibernateContext.prepareSession(HibernateContext.java:171)
      at
      org.jboss.hibernate.session.HibernateContext.getSession(HibernateContext.java:99)
      at
      de.bsd.adb_hibernate.server.ServerFacade.beispiel(ServerFacade.java:22)

      If I do it the classical way

      InitialContext ic = new InitialContext();
      Object o = ic.lookup("java:/hibernate/SessionFactory");
      sf = (SessionFactory)o;

      Session sess = sf.openSession()

      it works as intended.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                sebersole Steve Ebersole
                Reporter:
                sourceforge-user SourceForge legacy user
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: