-->
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: [Hibernate Shards] Does Shards really require JNDI?
PostPosted: Fri Aug 31, 2007 6:43 pm 
Newbie

Joined: Fri Aug 31, 2007 6:36 pm
Posts: 1
I am trying to put together a simple example, and run across this error:
WARNING: Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

I know this i s a warning, but in a bit then I get this error:
INFO: schema export complete
Exception in thread "main" java.lang.UnsupportedOperationException
at org.hibernate.shards.session.ShardedSessionFactoryImpl.getCurrentSession(ShardedSessionFactoryImpl.java:288)

Of course hunting around I see that having a <session-factory name="shard1"> in my cfg.xml files means I am trying to bind something in JNDI. Of course i just want a simple stand alone example, where can I get a simple boot strapped JNDI tree, or can I turn this off somehow, or is there some good shards getting started guide that I missed that tells me to use some command line switch that hours of searching has failed to uncover.

Or do I just need to suck it up, and also have a JBoss process running.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 02, 2007 8:52 pm 
Newbie

Joined: Wed Nov 29, 2006 3:59 am
Posts: 6
Are you calling getCurrentSession() or is something else calling it?

That method really is unimplemented right now (I'll look into taking care of that for next release), and you should use ShardedSessionFactory.openSession() to get a session.

-Tomislav


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.