1

I'm currently working on setting up an ant task to run the hibernate-tools task. If I run the ant task from the command line everything seems to be fine. If I try to run that same task using eclipse however it fails with the error:

java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z


Looking into common causes for that error, most of the information I found indicated that it was caused by an older version of the jpa libraries conflicting with the version that is added to the classpath. That does indeed appear to be the case here, but I'm at a loss for how to fix it. If I open up the run config for my ant task and look at the 'classpath' tab there is a listing labeled 'Additional Tasks & Support'. Within that lib is an 'ejb-persistence.jar' file that seems to be the root of the problem.

The question is, what can I actually do about it? I don't see any option to remove or exclude individual jars from the classpath. The only option is to completely remove that 'additional tasks & support' library which just ends up causing other issues. Any help would be greatly appreciated.

Environment:
OS: Ubuntu 18.04
Eclipse: 4.13
Hibernate: 3.6
JPA 2: 1.0.1

pbuchheit
  • 1,371
  • 1
  • 20
  • 47
  • Hi. Have you checked this? https://stackoverflow.com/a/32218505/1004631 – robot_alien Jan 21 '20 at 11:00
  • can you provide screen shot for error so it ore conceivable way to answer. – Sonu patel Jan 21 '20 at 13:06
  • @robot-alien Unfortunately that doesn't help. That bug has been fixed in the version of eclipse I'm using. Also, the problem is not that the build path is wrong. The problem is that I want to exclude certain libraries. – pbuchheit Jan 21 '20 at 14:49

0 Answers0