Exception thrown when using @Service in Kotlin

前端 未结 1 1436
广开言路
广开言路 2021-01-11 23:21

I\'m writing an SSM project in Kotlin and this happens as long as I try to annotate a class (a service implementation) with @Service.

  1. Trie
相关标签:
1条回答
  • 2021-01-11 23:45

    Kotlin's reflection facilities needed by Spring are shipped in a separate JAR. Try adding it into your build:

    build.gradle:

    compile 'org.jetbrains.kotlin:kotlin-reflect:1.1.51'
    

    pom.xml:

    <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-reflect</artifactId>
        <version>1.1.51</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题