Spring boot error:java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

后端 未结 9 970
小蘑菇
小蘑菇 2020-12-05 17:59

I want to use spring boot to start my application ,but after i add some relative jar at pom.xml,it return this error:and i thank may be it caused by some conflict jars?

相关标签:
9条回答
  • 2020-12-05 18:22

    If you are using spring JPA then make sure you have added the following dependency to pom.xml

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    
    0 讨论(0)
  • 2020-12-05 18:25

    The solution approach of adding

    spring-boot-starter-web-services

    dependency, proposed in the above answers, is good, working, but excessive in cases where you don't need web context to be raised up. I mean, if your application doesn't wish to be a web application. In such a case, at least for me, the adding of the following thinner dependency also resolved the issue:

    org.springframework:spring-webmvc

    implementation 'org.springframework:spring-webmvc:5.2.1.RELEASE'

    0 讨论(0)
  • 2020-12-05 18:27

    As explained by Andy Wilkinson in this GitHub issue or in this thread, these obscure exceptions occur when some annotation is referencing a class that isn't on the classpath.

    Most issues of this kind have been fixed in recent Spring Boot versions, but you can also trigger one from your code, for example when using @AutoConfigureAfter(X.class) where class X is missing on the classpath.

    0 讨论(0)
提交回复
热议问题