-->
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.  [ 5 posts ] 
Author Message
 Post subject: problem of HibernateUtil
PostPosted: Fri Sep 16, 2005 10:11 pm 
Newbie

Joined: Tue Sep 13, 2005 10:14 pm
Posts: 7
Hibernate version: 3

The programs still dies at building session factory.

However when I put all class of AbstractUserProfile,
UserProfile, UserProfileService and UserProfile.hbm.xml
and HibernateUtil under same dir as com.erp.hibernate, no problem.

But when AbstractUserProfile, UserProfile, UserProfileService
and UserProfile.hbm.xml are put under com.erp.hibernate.user,
the following error occurs,
java.lang.ExceptionInInitializerError
com.erp.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:21)
com.erp.hibernate.user.UserProfileService.getUserProfileList(UserProfileService.java:170)
org.apache.jsp.user.addUserProfile_jsp._jspService(org.apache.jsp.user.addUserProfile_jsp:140)


Any requirement putting HibernateUtil?

Thanks


private static final SessionFactory sessionFactory;

static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
log.error("Initial SessionFactory creation failed.", ex);
throw new ExceptionInInitializerError(ex);
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 11:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Check your log for the real exception.


Top
 Profile  
 
 Post subject: Re: problem of HibernateUtil
PostPosted: Sat Sep 17, 2005 11:16 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
pcleung wrote:
when I put all class of AbstractUserProfile,
UserProfile, UserProfileService and UserProfile.hbm.xml
and HibernateUtil under same dir as com.erp.hibernate, no problem.

But when AbstractUserProfile, UserProfile, UserProfileService
and UserProfile.hbm.xml are put under com.erp.hibernate.user,
the following error occurs


Post hibernate.cfg.xml . Check the mapping element of UserProfile.hbm.xml - make sure it is confgured for com/erp/hibernate/user (it looks like you have this configured for com/erp/hibernate ) . Also post UserProfile.hbm.xml - make sure it is configured w/ the right package.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Why should he post all that stuff? He just doesn't know where to look for the real exception.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 3:55 am 
Newbie

Joined: Tue Sep 13, 2005 10:14 pm
Posts: 7
Eventually I find that my Hibernate.cfg.xml has double line of UserProfile.hbm.xml.
I remove a line and everything is ok.


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