-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: SessionFactory binding and lookup in a weblogic cluster.
PostPosted: Mon Dec 22, 2008 7:17 am 
Newbie

Joined: Tue Jan 22, 2008 12:27 pm
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 23, 2008 6:29 am 
Newbie

Joined: Tue Jan 22, 2008 12:27 pm
Posts: 2
Ok, I finally found a solution in the Conflict start error with SessionFactory. I needed to add this to hibernate.cfg.xml:

<property name="hibernate.jndi.weblogic.jndi.replicateBindings">false</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.