Hey,
I have the following problem.
I need to create a new EntityManagerFactory and rebind it to the JNDI:
EntityManagerFactory emf = new Ejb3Configuration().setProperty( "hibernate.connection.datasource", "java:/DefaultDS").setProperty( "hibernate.hbm2ddl.auto", "create").setProperty("hibernate.show_sql", "true") .addAnnotatedClass(Hotel.class).addAnnotatedClass(Room.class) .buildEntityManagerFactory(); new InitialContext().rebind("java:/sample3", emf);