-->
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: Lookup of Session Factory in ContextFactory returning NULL
PostPosted: Wed Mar 17, 2010 2:02 pm 
Newbie

Joined: Wed Mar 17, 2010 1:36 pm
Posts: 1
Hi,

We have two separate war files application which are deployed on same weblogic JVM instance.
They are sharing a database.They have secondary level cache i.e. ehcache

But the problem while using two ehcache in same JVM is if one caches gets updated while a database operation other cache data becomes stale as it is not aware of the first cache data update.

Solution,I am trying to build is to share the org.hibernate.SessionFactory in both the application by exporting one to weblogic JNDI context factory and look up it using jndiTemplate.

I am able to export it and verified it on JNDITree and when i am doing look up from other war application or standalone java program ,it is throwing following error

Caused by: javax.naming.NameNotFoundException: JNDI object with [java.XXSessionFactory] not found: JNDI implementation returned null
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:156)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)


I tried weblogic context factory(weblogic.jndi.WLInitialContextFactory) and sun's RefFSContextFactory(com.sun.jndi.fscontext.RefFSContextFactory) to expose it as jndi using org.springframework.jndi.JndiTemplate but it doesn't seem to work.It is returning JNDI object as NULL.


Is there any way to make to share sessionFactory across the application deployed on JVM?
Thanks in advance for any advice/suggestions.


Top
 Profile  
 
 Post subject: Re: Lookup of Session Factory in ContextFactory returning NULL
PostPosted: Thu Mar 18, 2010 4:27 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Is there any way to make to share sessionFactory across the application deployed on JVM?


It should be possible and actually just through JNDI.
I would try to deploy hibernate in your application server as a JMX-service.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.