' org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter#0 ' __ Common mistakes

Source: Internet
Author: User
org.springframework.beans.factory.beancreationexception:error creating Bean with Name ' Org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter#0 ' defined in ServletContext Resource [/web-inf/spring.xml]: Cannot resolve reference to bean ' mappingjacksonhttpmessageconverter ' while setting bean Property ' Messageconverters ' with key [1]; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Mappingjacksonhttpmessageconverter ' defined in ServletContext resource [/web-inf/spring.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.noclassdeffounderror:org/codehaus/jackson/map/objectmapper 
caused By:java.lang.ClassNotFoundException:org.codehaus.jackson.map.ObjectMapper
This one's a little packet  Com.springsource.org.codehaus.jackson.mapper-1.4.2.jar.
caused By:java.lang.ClassNotFoundException:org.codehaus.jackson.ObjectCodec
Com.springsource.org.codehaus.jackson-1.4.2.jar
Start Normal
Attach  the contents of the configuration file
<bean class= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" >       <!--Configure a custom Webbindinginitializer based on annotations to resolve date conversion issues, method-level processor mappings-->      < Property Name= "Cacheseconds" value= "0"/>          <!--Configure the conversion of JSON data -->      <property name= "Messageconverters" >            <list>         <bean class= " Org.springframework.http.converter.ByteArrayHttpMessageConverter "/>         <ref bean= "Mappingjacksonhttpmessageconverter"/>        </list>       </property>  </bean>    <bean id= " Mappingjacksonhttpmessageconverter "Class=" Org.springframework.http.converter.json.MappingJacksonHttpMessageConverter ">  &NBSP;&Nbsp;   <!--processing the returned JSON data encoding, the default is Iso-88859-1, here we set it to UTF-8, if there is garbled situation, we just need to modify here on the-->       <property name= "Supportedmediatypes" >           <list>               <value>text/ 
html;charset=utf-8</value>           </list> 
      </property>   </bean>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.