java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType

发布于:2021-09-21 18:42:07

今天用springboot打包运行项目,发现总是报以下的错,刚开始以为是依赖包没引进,网上查了很久资料,都没解决,最后发现是fasterxml引进了两个版本的jar包,检查pom里面是不是有两个依赖,重新maven clean再打包,就可以解决了。


今天用springboot打包运行项目,发现总是报以下的错,刚开始以为是依赖包没引进,网上查了很久资料,都没解决,最后发现是fasterxml引进了两个版本的jar包,检查pom里面是不是有两个依赖,重新maven clean再打包,就可以解决了。


java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType(Lcom/fasterxml/jackson/databind/JavaType;)Lcom/fasterxml/jackson/databind/ObjectWriter;
?org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:279)
?org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106)
?org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:231)
?org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174)
?org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81)
?org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113)
?org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
?org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
?org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
?org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
?org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
?org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
?org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
?javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
?org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
?javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
?org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
?org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
?org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
?org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
?org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

相关推荐

最新更新

猜你喜欢