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
|