I am trying to upgrade my Hibernate version from
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
</dependency>
to
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.1.Final</version>
</dependency>
Unfortunately by compiling I get the following error.
TestDao.java:[5,25] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] location: package javax.transaction
I have been struggling with it for over an hour now.
I have tried adding package spring-tx
but it did not help.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
Did anyone face a similar issue?
spring-tx
gives you org.springframework.transaction.annotation.Transactional
, but your error message clearly states that you're trying to apply javax.transaction.Transactional
.
Searching for javax.transaction.Transactional
on Central shows a number of candidates; either javax.transaction:javax.transaction-api:1.2
or javax:javaee-api:7.0
looks like a reasonable option.
It appears that the POM for Hibernate 4.3 did include a dependency on the JBoss-specific version of the javax.transaction
package but that it was removed in Hibernate 5.0, presumably because it had been standardized and including a hard dependency on a specific package could result in problems at runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With