-->
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: JNDI troubles
PostPosted: Sat Sep 22, 2007 10:57 am 
Newbie

Joined: Sat Sep 22, 2007 10:46 am
Posts: 1
I was making a hello world with hibernate and the program throws the exception:

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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.getNameParser(InitialContext.java:480)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:291)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at persistence.HibernateUtil.<clinit>(HibernateUtil.java:16)
at org.hello.Main.main(Main.java:67)

If someone could help me, I'll be glad
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 22, 2007 12:07 pm 
Beginner
Beginner

Joined: Sat Jan 14, 2006 10:05 am
Posts: 22
Location: spb.ru
if you are authoring J2SE application, jndi binding for session factory isn't useful in most cases. Just avoid a specifing session factory name property in your hibernate.cfg.xml


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.