0

I am using spring 5.3.7 and when I start my application, it returns the error below:

Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:
Constructor threw exception; nested exception is java.lang.NoSuchFieldError:
com/fasterxml/jackson/annotation/JsonInclude$Include.USE_DEFAULTS

I am using jackson-annotations-2.10.3.jar which implements the USE_DEFAULTS Enum. I hope some one can help me.

op_
  • 92
  • 7

3 Answers3

1

Try cleaning your old build and rebuild your project, atleast it works for me!

0

I am not sure, but you should once check for the annotations like @Service, @Controller, @Respository, there are chances that you have missed any one of the annotations. just check it carefully, it might help you out.

Adarsh Gupta
  • 121
  • 1
  • 5
0

To deal with this error, we have to clear all .class files and recompile to ensure that all files are up to date.

If this error still exists at runtime, it may be that the dependency referenced at compile time is different from the runtime version. Here, it is necessary to check whether the various paths and versions are wrong.

Maven projects generally execute mvn clean.

Hope your problem can be solved

LHZ
  • 1
  • 1