-->
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: javax.naming.NoInitialContextException
PostPosted: Mon Sep 27, 2004 1:57 pm 
Beginner
Beginner

Joined: Thu May 20, 2004 3:40 pm
Posts: 33
Hibernate version:
2.1.6

JNDI error:

SessionFactory sessions = null;
try
{
Context ctx = new InitialContext();
String jndiname = "java:/hibernate/KJSSessionFactory";
sessions = (SessionFactory) ctx.lookup(jndiname);
s = sessions.openSession();

}
catch (NamingException nme)
{
nme.printStackTrace();
}

return s;

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:640)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.gs.aml.util.HibernateUtil.currentSession(HibernateUtil.java:84)
at com.gs.fw.gc.core.refs.DataSrcInstanceTB.main(DataSrcInstanceTB.java:115)
java.lang.NullPointerException
at com.gs.fw.gc.core.refs.DataSrcInstanceTB.main(DataSrcInstanceTB.java:118)
Exception in thread "main"

What do I need to specify??

Thanks,

Kenny


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Who would know? There is not enough information (why did you delete the questions in the text field?) and there is no Hibernate in your stacktrace.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.