Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hibernate datasource error

Status
Not open for further replies.

dexter195

Programmer
Jun 18, 2003
220
0
0
EU
hi,
ive reciently started using hibernate, the object oriented/relational database api.
ive gone through the tutorial on the hibernate site


its suppose to allow you to set it up in a tomcat server.

i keep getting the following errors, ive set it up according to the tutorial.

Code:
log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" net.sf.hibernate.HibernateException: Could not find datasource
	at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
	at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
	at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
	at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1160)
	at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:794)
	at net.sf.hibernate.examples.quickstart.HibernateUtility.currentSession(HibernateUtility.java:26)
	at net.sf.hibernate.examples.quickstart.CreateCat.main(CreateCat.java:11)
Caused by: 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.lookup(Unknown Source)
	at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
	... 6 more

thanks for any help you can give me

dex
 
It looks like it is trying to connect to a DB that it is not able to find. Are you trying to use the hibernate connection pooling? I think the example may use HSSQL. You may want to make sure the DB is configured OK.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top