[ http://jira.jboss.com/jira/browse/HIBERNATE-4?page=history ]
Ryan Campbell reassigned HIBERNATE-4: ------------------------------------- Assign To: Steve Ebersole (was: Gavin King) > NPE in HibernateContext.prepareSession > -------------------------------------- > > Key: HIBERNATE-4 > URL: http://jira.jboss.com/jira/browse/HIBERNATE-4 > Project: Hibernate > Type: Bug > Reporter: SourceForge User > Assignee: Steve Ebersole > Priority: Minor > > > 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development