-->
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: NoSuchMethodError orphanRemoval()Z error
PostPosted: Sat Sep 24, 2011 8:00 am 
Newbie

Joined: Sat Sep 24, 2011 7:55 am
Posts: 2
Hi,

I am new to hibernate and trying to use the @OneToOne annotation, but I am getting the following error during runtime:

Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1641)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:796)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:707)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)

I am using hibernate-distribution-3.6.7.Final and jre 6.x.

Can anyone help me out in this ?

Regards
John


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError orphanRemoval()Z error
PostPosted: Sat Sep 24, 2011 8:21 am 
Newbie

Joined: Sat Sep 24, 2011 7:55 am
Posts: 2
Hi,

I got the answer myself. The reason it was happening was because I had javax-persistence jar file added to the classpath along with the hibernate-jpa-2.0-api-1.0.1.Final.jar
and it got into a conflict. Removing javax-persistence jar file solved it.

Maybe, it might help some novice like me.

Regards
John


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.