-->
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.  [ 2 posts ] 
Author Message
 Post subject: How can I resolve java.lang.ExceptionInInitializerError?
PostPosted: Fri Mar 09, 2012 2:58 pm 
Newbie

Joined: Fri Mar 09, 2012 2:25 pm
Posts: 1
Hi Friends, I am using Hibernate for my <b>web application..<b>

I have an exception <b>java.lang.ExceptionInInitializerError</b>
when ever i call Hibernate method to insert..

My code is very simple as shown in basic tutorials of Hibernate :
static {
try {
// Create the SessionFactory from standard (hibernate.cfg.xml)
// config file.

sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
//In above line the cause of exception
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}

When ever I put mouse over this error it show's me like:
org.Hibernate.DuplicateMappingException

I am not getting to the problem..
Can any one help me?


Top
 Profile  
 
 Post subject: Re: How can I resolve java.lang.ExceptionInInitializerError?
PostPosted: Mon Mar 12, 2012 3:38 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
org.Hibernate.DuplicateMappingException means that you defined some entity class or property twice which is not allowed.
The error lies most probably in how you mapped your persistent classes.


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