sessionfactory « Tomcat « JPA Q&A





1. Hibernate SessionFactory: how to configure JNDI in Tomcat?    stackoverflow.com

that's how the session factory should be gotten:

    protected SessionFactory getSessionFactory() {
        try {
        ...

3. Problem with access to SessionFactory in JNDI, Tomcat 5.5    forum.hibernate.org

Hi I use Hibernate-Version: 3.2.0.cr5 apache-tomcat-5.5.17 In hibernate.cfg.xml I put Code: HibernateSessionFactory Also made listener with code: Code: sessionFactory = new Configuration().configure().buildSessionFactory(); After this I receive SessionFactory by: Code: initCtx = new InitialContext(); SessionFactory ses = (SessionFactory) envCtx.lookup("HibernateSessionFactory"); So, where is the problem ? :) I want to map SessionFactory object in JNDI with name "java:comp/env" for example. When I ...

4. Hibernate won't build SessionFactory under Eclipse Tomcat    forum.hibernate.org

I'm using Hibernate 3.3, Tomcat 6, and Eclipse Galileo and I get the following exception from Configuration.configure().buildSessionFactory(): 13:00:35,843 INFO SessionFactoryObjectFactory:109 - Factory name: java:comp/env/jdbc/bmf 13:00:35,843 INFO NamingHelper:49 - JNDI InitialContext properties:{} 13:00:35,843 WARN SessionFactoryObjectFactory:121 - Could not bind factory to JNDI javax.naming.NamingException: Context is read only at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903) at org.apache.naming.NamingContext.bind(NamingContext.java:831) at org.apache.naming.NamingContext.rebind(NamingContext.java:208) at org.hibernate.util.NamingHelper.bind(NamingHelper.java:97) at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:348) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341) ... ...