File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes persistence and hibernate jar conflicts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "persistence and hibernate jar conflicts" Watch "persistence and hibernate jar conflicts" New topic
Author

persistence and hibernate jar conflicts

Hari Gundappa
Greenhorn

Joined: Sep 13, 2011
Posts: 27
Hi

I get this exception while deploying my enterprise app on WAS 6.1.x.
Caused by: java.lang.NoSuchMethodError: javax/persistence/OneToOne.orphanRemoval()Z


Some litreture on internet mention its the jar problem and in my case it is. I have ejb3-persistence.jar and hibernate3.jar both of which have this class and hence the conflict.

However as the solutions suggested on the internet( remove one of them) I can't remove either one of them as, I need the javax.persistence packages for all my annotations and hibernate of the orm stuff.

I am completely stuck here and need some help.

Can some please suggest a combination or solution to this?

THanks,
Hari
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3673

Have you tried hibernate-jpa-xxx.jar in place of ejb3-persistence.jar?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Hari Gundappa
Greenhorn

Joined: Sep 13, 2011
Posts: 27
Hi,

I removed the ejb3-persistenc jar and have the hibernate-jpa-2.0-api-1.0.0.Final.jar. But now this error pops up


Caused by: java.lang.NoSuchMethodError: javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;


Please advise.

Thanks,
Narahari
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: persistence and hibernate jar conflicts
 
Similar Threads
Learning Hibernate & Spring
Multiple persistance unit simultaneously, issue.
Hibernate Book
Book for hibernate
Running unit tests and getting NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z