0

I don't know what went wrong.

I'll attach the sources and advice to me why the error is happening..

pom.xml

  <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-webmvc</artifactId>
     <version>4.3.8.RELEASE</version>
  </dependency>

that is error code

org.springframework.beans.factory.BeanInitializationException: Error loading DispatcherServlet's default strategy class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver] for interface [org.springframework.web.servlet.HandlerExceptionResolver]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/annotation/SynthesizingMethodParameter
    at org.springframework.web.servlet.DispatcherServlet.getDefaultStrategies(DispatcherServlet.java:830)
    at org.springframework.web.servlet.DispatcherServlet.initHandlerExceptionResolvers(DispatcherServlet.java:669)
    at org.springframework.web.servlet.DispatcherServlet.initStrategies(DispatcherServlet.java:489)
    at org.springframework.web.servlet.DispatcherServlet.onRefresh(DispatcherServlet.java:476)
    at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:806)
    at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1121)
    at 

I don't know why I get an error.

please let me know how to fix the problem.

Jeroen
  • 1,212
  • 10
  • 24
Seongwon-Choi
  • 459
  • 8
  • 24

2 Answers2

1

You need to add a dependency to spring-core in your pom.xml. The fragment below should fix your issue:

<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.8.RELEASE</version>
</dependency>
Totò
  • 1,824
  • 15
  • 20
  • I also have that dependency. but my pom.xml have spring-core version is 4.1.6.. I modify version it is work. Is there a difference between the different versions? – Seongwon-Choi Aug 02 '17 at 06:49
  • 1
    Apparently there is... You can check the change logs if you have time for that. If I have to throw a guess that class must have been changed or introduced after 4.1.6 – Totò Aug 02 '17 at 06:53
1

There is a NoClassDefFoundErrorand I suppose that you did not include spring-core. Below is the missing dependency that should be added to the pom.xml:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.8.RELEASE</version>
</dependency>
Yuri
  • 1,748
  • 2
  • 23
  • 26
  • I also have that dependency. but my pom.xml have spring-core version is 4.1.6.. I modify version. and it is work. Is there a difference between the different versions? – Seongwon-Choi Aug 02 '17 at 06:49
  • 1
    Yes it is. This class `SynthesizingMethodParameter` from the error was only added in version 4.2. – Yuri Aug 02 '17 at 06:49
  • 1
    If the issue was solved - could you check this question as answered in order not to paste more answers for you as this question stays open for now :) – Yuri Aug 02 '17 at 06:51