-->
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: hibernate IdentifierGenerationException after upgrade
PostPosted: Tue Mar 30, 2010 7:13 am 
Newbie

Joined: Tue Mar 30, 2010 6:29 am
Posts: 2
Hi to all.
since when I upgraded the hibernate3.jar in my java/struts/mysql/tomcat application, I have this error in the stack:


javax.servlet.ServletException: Servlet execution threw an exception
...

root cause

org.hibernate.id.IdentifierGenerationException: no natural-id property defined; need to specify [key] in generator parameters
org.hibernate.id.SelectGenerator.determineNameOfPropertyToUse(SelectGenerator.java:73)
org.hibernate.id.SelectGenerator.access$100(SelectGenerator.java:52)
org.hibernate.id.SelectGenerator$SelectGeneratorDelegate.<init>(SelectGenerator.java:117)
org.hibernate.id.SelectGenerator$SelectGeneratorDelegate.<init>(SelectGenerator.java:98)
org.hibernate.id.SelectGenerator.getInsertGeneratedIdentifierDelegate(SelectGenerator.java:64)
org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:3145)
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:439)
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:272)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)


So I tried to replace the slf4j library with other versions, added slf4j-api, slf4j-jdk ,etc but unsuccessfully.
I tried another versione of hibernate3.jar, but the problem stay the same.

Could you please help me?
I don't know what to do.
thanks in advance.


Top
 Profile  
 
 Post subject: Re: hibernate IdentifierGenerationException after upgrade
PostPosted: Wed Mar 31, 2010 11:54 am 
Newbie

Joined: Tue Mar 30, 2010 6:29 am
Posts: 2
I changed the generator class from "select" to "identity".
Now it works.


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.