-->
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.  [ 6 posts ] 
Author Message
 Post subject: question about hibernate
PostPosted: Wed Oct 26, 2005 5:47 am 
Newbie

Joined: Wed Oct 26, 2005 5:31 am
Posts: 6
Hello,
I want to know if hibenrnate may be used without an application server (a project done with Jbuilder or similar)?

Thank you
Bye


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 5:50 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Yes it can. Hibernate does not require an application server and can be used in a multitude of applications.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 5:54 am 
Newbie

Joined: Wed Oct 26, 2005 5:31 am
Posts: 6
ok thanks!
I asked for that because i have a problem with the configuration of the connection to mysql DB.
I'm using hibernate 3.1 and and mysql 4. This is the error

Code:
GRAVE: Could not find datasource: java:comp/env/jdbc/assistenza
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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
   at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
   at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at HibernateUtil.<clinit>(HibernateUtil.java:16)
   at Go.main(Go.java:25)
26-ott-2005 10.43.12 HibernateUtil <clinit>
GRAVE: Initial SessionFactory creation failed.
org.hibernate.HibernateException: Could not find datasource
   at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
   at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
   at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at HibernateUtil.<clinit>(HibernateUtil.java:16)
   at Go.main(Go.java:25)
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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
   ... 7 more
Exception in thread "main" java.lang.ExceptionInInitializerError
   at HibernateUtil.<clinit>(HibernateUtil.java:20)
   at Go.main(Go.java:25)
Caused by: org.hibernate.HibernateException: Could not find datasource
   at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
   at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
   at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at HibernateUtil.<clinit>(HibernateUtil.java:16)
   ... 1 more
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 org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
   ... 7 more


Do you koow where the matter is?
Thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 6:06 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You don't have a JNDI registry or a registry that needs extra initial context parameters - which you could configure in Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 6:43 am 
Newbie

Joined: Wed Oct 26, 2005 5:31 am
Posts: 6
ok thanks.
Can u tell me the steps to configure ibernatate?
I have write the file hiberbate.cfg.xml, the file .hbm.xml and write the class HibernateUtil. There are more configuration to do?
Thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 6:46 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/ForumMailingli ... AskForHelp
this

First item.


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