2 jspdns jspdns 于 2014.08.21 14:20 提问

spring mvc程序运行tomcat错误

代码信息:













错误信息:
org.springframework.web.servlet.DispatcherServlet]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JacksonHttpMessageConverter' defined in class path resource [springmvc.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1041)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4932)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5218)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
... 32 more
Caused by: java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:36)
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:20)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:42)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:15)
at org.codehaus.jackson.map.ObjectMapper.(ObjectMapper.java:42)
at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.(MappingJacksonHttpMessageConverter.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 34 more
八月 21, 2014 2:11:10 下午 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JacksonHttpMessageConverter' defined in class path resource [springmvc.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1041)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4932)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5218)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
... 32 more
Caused by: java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:36)
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:20)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:42)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:15)
at org.codehaus.jackson.map.ObjectMapper.(ObjectMapper.java:42)
at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.(MappingJacksonHttpMessageConverter.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 34 more
八月 21, 2014 2:11:10 下午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /myspringtest1 threw load() exception
java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:36)
at org.codehaus.jackson.map.type.SimpleType.(SimpleType.java:20)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:42)
at org.codehaus.jackson.map.type.TypeFactory.(TypeFactory.java:15)
at org.codehaus.jackson.map.ObjectMapper.(ObjectMapper.java:42)
at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.(MappingJacksonHttpMessageConverter.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1041)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4932)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5218)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
八月 21, 2014 2:11:10 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Java Develope\apache-tomcat-8.0.9\webapps\myspringtest1 has finished in 10,306 ms
八月 21, 2014 2:11:10 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Java Develope\apache-tomcat-8.0.9\webapps\ROOT
八月 21, 2014 2:11:10 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Java Develope\apache-tomcat-8.0.9\webapps\ROOT has finished in 28 ms
八月 21, 2014 2:11:10 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
八月 21, 2014 2:11:10 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
八月 21, 2014 2:11:10 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 12114 ms

1个回答

xiaoxiao_shenle
xiaoxiao_shenle   2014.08.21 21:52

你写的JavaType这个类中 缺少了一些必要的方法 你检查一下啦

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
记录一次让我吐血的spring3 MVC HTTP406 Json转换错误
记录一次解决spring3 MVC 问题的吐血经历,绝对是你想象不到的结果! HTTP 406问题的修正
解决spring mvc3.1下post json出现 400 后台不报错问题
转载自:http://www.haogongju.net/art/1515951 问题描述: 已声明 @RequestMapping(value="update", method = RequestMethod.POST)         @ResponseBody          public Map updateNavi(@RequestBody Navigation m
springMVC监听tomcat服务器的启动与关闭
第一步:编写一个类,实现ServletContextListener接口, public class TomcatListen implements ServletContextListener{ @Override public void contextInitialized(ServletContextEvent servletContextEvent) {
Spring MVC + TomCat 环境搭建
1.spring 需要的jar 包 spring框架配置 01. 02.<web-app 03. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 04. xmlns="http://java.sun.com/xml/ns/javaee" 05. xmlns:web="http://java
使用内嵌TOMCAT 8 开发spring mvc 项目
1、依赖POM(需要JDK 8)   &amp;lt;dependency&amp;gt;            &amp;lt;groupId&amp;gt;org.apache.tomcat.embed&amp;lt;/groupId&amp;gt;            &amp;lt;artifactId&amp;gt;tomcat-embed-core&amp;lt;/artifactId&amp;gt;            &amp;lt;version&amp;gt;8.0....
Eclipse+tomcat+maven 配置Spring mvc图文教程
一、基础环境(eclipse+tomcat+jdk+maven) 1.安装jdk: 下载并安装jdk,(过程比较简单就略过了)。 配置环境变量:按照java 默认安装路径需要配置为: JAVA_HOME: C:\Program Files\Java\jdk1.6.0_07 (注意JAVA_HOME 路径后面不能有分号。) path:%JAVA_HOME%\bin; classp
Java Spring MVC 入门- HelloWord+配置IntelliJ idea的Tomcat服务器
**本例使用IntelliJ IDEA 2016.2.5编写,运行环境:tomcat7.0.70测试通过。** 本项目主要讲述创建java spring mvc hello word的步骤及怎么配置idea 的tomcat服务器。
基于Spring MVC和Tomcat服务器的JavaWeb项目----入门篇
1 软件工具准备(1) JDK: jdk-8u92-windows-i586.exe (jdk1.8.0_92) (2) Eclipse:eclipse-jee-luna-SR2-win32.zip (3) Tomcat: apache-tomcat-7.0.70-windows-x86.zip (4) Spring-framework: spring-framework-4.3.2.RELE
最简集成SpringMVC、纯手工打包部署到tomcat
前面已经介绍了tomcat,了解了其简单的部署方法;以及Listener、Filter、Servlet的概念,并且自己写了写,实现了网站的简单访问。 注意到了这里和我们的SpringMVC还完全没有关系。 今天来看怎么集成SpringMVC到我们的项目中 SpringMVC文档地址; https://docs.spring.io/spring/docs/current/spring-fra
Spring MVC+tomcat+mysql+Ubuntu项目部署的笔记
安装文件是mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz,将解压后的mysql文件放在/usr/local目录下。 在mysql的scripts目录下执行 ./mysql_install_db --user=deploy --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data命令 第一次执行的时候