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.  [ 1 post ] 
Author Message
 Post subject: Naming exception occring while building session factory
PostPosted: Fri Jun 08, 2007 8:47 am 
Newbie

Joined: Fri Jun 01, 2007 1:31 pm
Posts: 2
Location: Bangalore
Hi

can anyone help me, I am getting following exception when I am running my hibernate code from command line.



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(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getNameParser(Unknown Source)
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:306)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.ballydev.sds.accounting.util.HibernateUtil.<clinit>(HibernateUtil.java:53)
at com.ballydev.sds.accounting.dao.GenericDAOImpl.getSession(GenericDAOImpl.java:43)
at com.ballydev.sds.accounting.dao.GenericDAOImpl.findAll(GenericDAOImpl.java:69)
at com.ballydev.sds.accounting.util.SDSAccountingUtil.getExternalSystemMap(SDSAccountingUtil.java:53)
at com.ballydev.sds.accounting.AccountingThread.<init>(AccountingThread.java:45)
at com.ballydev.sds.accounting.AccountingDaemon.main(AccountingDaemon.java:84)


I am not using any server session Factory.

my cfg file looks like.

<session-factory name="AccountingHibernate">

<!-- Database connection settings -->
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.url">URL</property>
<property name="hibernate.connection.username">USER NAME</property>
<property name="hibernate.connection.password">PASS</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>

<property name="hibernate.format_sql">true</property>
<property name="hibernate.show_sql">true</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.