Hi all, we have trouble deploying our application in a clustered environment in Weblogic 10.3. Hibernate version is 3.2.5GA.
It seems that the Session Factory is bound only to one node in the cluster, because I'm getting the following error in the logs:
<Dec 22, 2008 11:53:54 AM EET> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an object under the name hbm.ceprocHibernate in the JNDI tree. The object from <edited> is non-clusterable, and you have tried to bind more than once from two or more servers. Such objects can only be deployed from one server.>
Currently I'm trying to get the session factory like this:
Code:
public static SessionFactory getSessionFactory() throws NamingException {
SessionFactory sessions = null;
Context ctx = new InitialContext();
log.debug("Getting hibernate session factory (" + HIBERNATE_JNDI_NAME + ")");
sessions = (SessionFactory)ctx.lookup(HIBERNATE_JNDI_NAME);
ctx.close();
return sessions;
}
We've put jndi.properties with the correct PROVIDER_URL and INITIAL_CONTEXT_FACTORY in myapp-common.jar and this jar is placed in the lib directory of the ear package. However this does not seem to work. If I change the above code for the factory to use a hashtable to pass the PROVIDER_URL and the INITIAL_CONTEXT_FACTORY things seem to work. Should I follow the later approach or should I place jndi.properties in another directory?
Also, what happens if the node that has binded the session factory in jndi fails?
Thanks