getting package org.springframework.transaction.annotation does not exist error while packaging app

后端 未结 3 1644
轻奢々
轻奢々 2021-02-20 17:31

I am quite new in Spring world. I have developed a DAO using Spring 3.2 and Hibernate 4.1.9 but I have noticed a strange thing.

All the used dependencies related to Spri

相关标签:
3条回答
  • 2021-02-20 17:59

    The @Transactional annotation is in the spring-tx module. Include version 3.2.1 of that, and always make sure to use the same version of all Spring modules.

    0 讨论(0)
  • 2021-02-20 18:13

    Try using all spring related dependencies of same version. I guess org.springframework.transaction.annotation.Transactional is present in spring 3.2.0. So this should not be issue. Include spring-tx dependency for @Transactionl to work.

    0 讨论(0)
  • 2021-02-20 18:15

    The package org.springframework.transaction is provided by the spring-tx artifact. Add the following to your pom.xml and do maven update, that should do:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题