Hibernate JPA and javax persistence conflicts while upgrading to Spring 5.3.20

Viewed 172

We're trying to upgrade the spring version on our existing project to 5.3.20 from 3.0.3. We've been stuck on the same errors and circling around it for weeks now. We're using normal Spring framework. It's not a maven project. I've also updated hibernate from 3.x to 5.1.2 (I've also tried using 5.6.9 and went through the same issue) From all that I've done until now to fix this issue, this is what I've understood:

I'm using hibernate JPA 2.1 api 1.0.2 and javax persistance api 2.2. There are 2 issues. When I use both together I get this error:

java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;

when I try removing javax persistence - I get this TableGenerators class not found error. and when I remove JPA I get JoinColoumns.ForeignKey() method not found error. What am I doing wrong? Am I missing something? Is there a way to exclude certain classes from these jars if it's not a maven project? Is the actual issue something else altogether?

Stacktrace

[![enter image description here][1]][1]

0 Answers
Related