Hi,
I have a problem in integrating jboss 4.0.2 and Hibernate 3.1.I wrote the hibernate service and deployed in jboss,
I connected to the service in a web application and got the SessionFactoty with this code :
InitialContext ctx = new InitialContext();
SessionFactory factory = (SessionFactory)
ctx.lookup("SessionFactory");
It worked fine. But when I want to connect to the service in a windows application it fails.
I configure the jndi.properties file correctly and put it in classpath, then I put the same code and execute in application, the lookup process works fine, but the sessionfactory which is returned is NULL.
Can anyone tell me what the process of connecting in windows application is?
Is the hibernate-cfg.xml in this case is necessary ?
Thanks,
|