views:

486

answers:

1

that's how the session factory should be gotten:

    protected SessionFactory getSessionFactory() {
        try {
            return (SessionFactory) new InitialContext()
                    .lookup("SessionFactory");
        } catch (Exception e) {
        }
    }

Please provide a simple solution for Tomcat6 to be able to get SessionFactory thru simple jndi lookup in Java code. What should be written in what file on the side of Tomcat ?

A: 

Here's a link http://community.jboss.org/wiki/UsingJNDI-boundSessionFactorywithTomcat41

But other answers are welcome as well.

EugeneP