-->
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.  [ 4 posts ] 
Author Message
 Post subject: NoInitialContextException
PostPosted: Fri Nov 28, 2003 11:31 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
Dear all,
I have this exception and I don't understand where it comes from; NEED HELP !
Actually, I have implemented a singleton for the sessionFactory and maybe it comes from that ?????

Code:
16:27:57,609 FATAL DatasourceConnectionProvider:47 - Could not find datasource: java:comp/env/jdbc/Technique
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 net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
   at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
   at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
   at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1023)
   at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:716)
   at fr.gouv.finances.dgi.opale.technique.util.SessionFactoryHibernate.getSessionFactory(SessionFactoryHibernate.java:31)
   at fr.gouv.finances.dgi.opale.technique.util.SessionHibernate.initHibernate(SessionHibernate.java:39)
   at TestCnxDB.main(TestCnxDB.java:112)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2003 12:09 pm 
Newbie

Joined: Tue Nov 25, 2003 5:05 pm
Posts: 18
I assume that you use hibernate inside an J2EE application server like JBoss. Is this the case?

Please try to look up the datasource without hibernate first. Does this work?

ciao
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2003 12:12 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
Sven! wrote:
I assume that you use hibernate inside an J2EE application server like JBoss. Is this the case?

Please try to look up the datasource without hibernate first. Does this work?

ciao
Sven


Actually I use Tomcat but it is not the problem because i have this when using jbuilder during debugging


Top
 Profile  
 
 Post subject: JBoss or Tomcat?
PostPosted: Fri Nov 28, 2003 8:03 pm 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
I'm confused if that message was from Tomcat or JBoss? If Tomcat, you shouldn't try using "java:comp/env" as your JNDI name space. It's read-only in Tomcat. In Tomcat you can create any JNDI name and hibernate will create the context for you. I use my initials as part of my contenxt and don't have to change anything except my hibnerate.cfg.xml (no server.xml or web.xml changes): dgf:hibernate/SessionFactory

I've done this using hibernate v.2.0.2 and v2.1beta6 while on Tomcat 4.1.24/.27/.29.

Regards,
David


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.