为了账号安全,请及时绑定邮箱和手机立即绑定

Tomcat启动报错Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter'

严重: StandardWrapper.Throwable

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': 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.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1231)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1130)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)

at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:676)

at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:642)

at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:690)

at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:558)

at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:499)

at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:172)

at javax.servlet.GenericServlet.init(GenericServlet.java:158)

at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1227)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1140)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5038)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5348)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:175)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:88)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1223)

... 29 more

Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:67)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.<init>(RequestMappingHandlerAdapter.java:190)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)

... 31 more

Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

... 38 more


正在回答

6 回答

我也弄了好久才好的,原因是jdbc.properties 上面不能有任何空格。原先我在java端都可以测试,但在页面输出就出现这问题,原来里面是不能有空格的

0 回复 有任何疑惑可以回复我~

fasterxml 依赖包不兼容   试试最新的包  

0 回复 有任何疑惑可以回复我~

同样报错,可是我的jdbc.properties上并没有空格啊……绝望

1 回复 有任何疑惑可以回复我~

兄弟,你这个问题找到原因了嘛

0 回复 有任何疑惑可以回复我~
#1

一止白水 提问者

嗯,是我的jdbc.properties中有属性值后面多写空格,找了好久
2018-01-21 回复 有任何疑惑可以回复我~
  1. seckillControler.java

    http://img1.sycdn.imooc.com//5a2362a70001b2cf11982111.jpg

    2.spring-web.xml

    http://img1.sycdn.imooc.com//5a2362ad0001475512080659.jpg

  2. web.xml

  3. http://img1.sycdn.imooc.com//5a2362ae00013f5413600768.jpg

1 回复 有任何疑惑可以回复我~
#1

一止白水 提问者

我的原因找到了,jdbc的配置文件中,有空格
2018-11-19 回复 有任何疑惑可以回复我~

有代码吗?

0 回复 有任何疑惑可以回复我~
#1

一止白水 提问者

我在下条评论贴出来了
2017-12-03 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

Tomcat启动报错Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter'

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信