ad-sponsor 项目启动报错
来源:8-6 【在理解的基础上编码】索引操作Handler的定义与说明

weixin_慕先生7576564
2019-05-03
ad-sponsor 项目启动报错
错误信息:
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-05-03 17:44:17.469 ERROR 12888 — [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerAdapter’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationEnableWebMvcConfiguration.class]:Beaninstantiationviafactorymethodfailed;nestedexceptionisorg.springframework.beans.BeanInstantiationException:Failedtoinstantiate[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:Factorymethod′requestMappingHandlerAdapter′threwexception;nestedexceptionisjava.lang.NoClassDefFoundError:com/fasterxml/jackson/dataformat/cbor/CBORFactoryatorg.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) [spring−beans−5.0.6.RELEASE.jar:5.0.6.RELEASE]atorg.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationEnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/dataformat/cbor/CBORFactory
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationEnableWebMvcConfiguration.class]:Beaninstantiationviafactorymethodfailed;nestedexceptionisorg.springframework.beans.BeanInstantiationException:Failedtoinstantiate[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:Factorymethod′requestMappingHandlerAdapter′threwexception;nestedexceptionisjava.lang.NoClassDefFoundError:com/fasterxml/jackson/dataformat/cbor/CBORFactoryatorg.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) [spring−beans−5.0.6.RELEASE.jar:5.0.6.RELEASE]atorg.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationEnableWebMvcConfigurationEnhancerBySpringCGLIBEnhancerBySpringCGLIBEnhancerBySpringCGLIBcd5bf69fFastClassBySpringCGLIBFastClassBySpringCGLIBFastClassBySpringCGLIB48d742a9.invoke() ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancerBeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) [spring−context−5.0.6.RELEASE.jar:5.0.6.RELEASE]atorg.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationBeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationBeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) [spring−context−5.0.6.RELEASE.jar:5.0.6.RELEASE]atorg.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfigurationEnableWebMvcConfigurationEnhancerBySpringCGLIBEnhancerBySpringCGLIBEnhancerBySpringCGLIBcd5bf69f.requestMappingHandlerAdapter() ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
… 19 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.dataformat.cbor.CBORFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_211]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_211]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_211]
… 38 common frames omitted
Process finished with exit code 1
2回答
-
weixin_慕先生7576564
提问者
2019-05-03
老师您好,我postman调用 提示这个是什么问题,谢谢老师的回复。
122019-05-03 -
张勤一
2019-05-03
同学你好:
从报错信息(最后是截图)来看,是 pom 文件中配置的依赖没有生效或者是配置错误,两个解决办法:
1. 直接粘贴我在 git 中给出的源码中的 pom 配置:https://git.imooc.com/coding-310/Imooc-Ad/src/master/project
2. 在 pom 文件所在目录下执行 mvn compile 命令,根据错误排查 pom 文件的问题
欢迎来 QQ 群随时交流、讨论,也非常感谢同学的支持!
10
相似问题