[JBoss-dev] [JBoss JIRA] Commented: (HIBERNATE-4) NPE in HibernateContext.prepareSession
[ http://jira.jboss.com/jira/browse/HIBERNATE-4?page=comments#action_12314716 ] sandro duarte commented on HIBERNATE-4: --- Yes, that was the case... The call was not made inside a Transaction. The problem was the non-usefull error message. After installing JBoss 4.0.1 the error persisted but the error message show me the way. Thanks for the follow-up. > 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, almosthttp://www.thinkgeek.com/sfshirt ___ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] [JBoss JIRA] Commented: (HIBERNATE-4) NPE in HibernateContext.prepareSession
[ http://jira.jboss.com/jira/browse/HIBERNATE-4?page=comments#action_12314630 ] sandro duarte commented on HIBERNATE-4: --- Having the same problem here: java.lang.NullPointerException at org.jboss.hibernate.session.HibernateContext.prepareSession(HibernateContext.java:171) at org.jboss.hibernate.session.HibernateContext.getSession(HibernateContext.java:99) at tre.rs.scai.service.ConsultaExtratoCommand.execute(Unknown Source) Jboss 4.0.0 WinXP > NPE in HibernateContext.prepareSession > -- > > Key: HIBERNATE-4 > URL: http://jira.jboss.com/jira/browse/HIBERNATE-4 > Project: Hibernate > Type: Bug > Reporter: SourceForge User > Assignee: Gavin King > 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, almosthttp://www.thinkgeek.com/sfshirt ___ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development