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?
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>
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'
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.