-->
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: Error in the configuration of build settings
PostPosted: Wed Aug 30, 2006 10:21 pm 
Newbie

Joined: Wed Aug 30, 2006 9:39 pm
Posts: 1
I am having a problem in building the SessionFactory for Hibernate 3.0

This is the code i wrote:

//Configure hibernate
org.hibernate.cfg.Configuration Config =
new org.hibernate.cfg.Configuration();
Config.setProperties(properties);

StringTokenizer st = new StringTokenizer
(properties.getProperty("waterdonate.persistant"), ",");
while (st.hasMoreTokens()) {
String currentToken = st.nextToken();
try {
Config.addClass(Class
.forName(currentToken.trim()));
} catch (ClassNotFoundException e) {
logger.error("Can not find class " + currentToken, e);
} catch (org.hibernate.MappingException e) {
logger.error("Can not find map for class " + currentToken, e);
}
}


try {

Waterdonate.setSessionFactory(Config.buildSessionFactory()); logger.info("Hibernate configured successfully");
} catch (org.hibernate.HibernateException e) {
logger.fatal("Could not create Hibernate SessionFactory", e);
return;
}

I am getting errors of this kind

at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at com.waterdonate.configuration.WaterdonateConfigurator.configure(WaterdonateConfigurator.java:141)
at com.waterdonate.configuration.WaterdonateConfigurator.init(WaterdonateConfigurator.java:60)

Waterdonate is my DB.

help me to solve the code at this place

Waterdonate.setSessionFactory(Config.buildSessionFactory()); logger.info("Hibernate configured successfully");

thanks in advance
dan


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.