Spring @Transactional not working after migrating to Spring 5

45 Views Asked by At

I have recently upgraded application from Spring 4.3.x and JDK 8 with AspectJ 1.8.10 to JDK 17 with Spring 5.3.x and AspectJ 1.9.20.1 and Transactional annotation seems to be not working

In application configuration there is

<tx:annotation-driven transaction-manager="transactionManager" mode="aspectj"/>
<context:load-time-weaver/>

I tried defining AnnotationTransactionAspect, changing AspectJ version but nothing seems to help resolve this issue.

1

There are 1 best solutions below

0
kriegaex On

Did you read the "Use LTW on Java 16+" part of the release notes? For load-time weaving, you need to add --add-opens java.base/java.lang=ALL-UNNAMED to your JVM command line.