2012-12-12 17 views
1

我收到錯誤NOClassDefFound的組織/ Codehaus的/傑克遜/地圖/ objectmapper,我的Spring XML文件中像下面關於Spring MVC的錯誤無級高清發現

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd 
    http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
    "> 
<mvc:annotation-driven /> 
<context:component-scan base-package="org.package.servletname" /> 

<bean 
    class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> 
    <property name="mediaTypes"> 
     <map> 
      <entry key="atom" value="application/atom+xml" /> 
      <entry key="html" value="text/html" /> 
      <entry key="json" value="application/json" /> 
     </map> 
    </property> 
    <property name="viewResolvers"> 
     <list> 
      <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" /> 
      <bean 
       class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
       <property name="prefix" value="/WEB-INF/jsp/" /> 
       <property name="suffix" value=".jsp" /> 
      </bean> 
     </list> 
    </property> 
    <property name="defaultViews"> 
     <list> 
      <bean 
       class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" /> 
     </list> 
    </property> 
</bean> 

<mvc:resources mapping="/css/**" location="/css/" /> 
<mvc:resources mapping="/img/**" location="/img/" /> 
<mvc:resources mapping="/js/**" location="/js/" /> 

</beans> 

我想用我的春天地圖JSON ,所以請指教。

回答

1

錯誤清楚地表明您的classpath中沒有Jackson JAR。你在你的classpath中添加了Jackson JSON JAR文件嗎?

  • 傑克遜 - 註解-2.1.1.jar(download
  • 傑克遜 - 芯 - 2.1.1.jar(download
  • 傑克遜 - 數據綁定-2.1.1.jar (download)
+0

是的,我做了,我得到這個錯誤 – user1861639

+0

我試圖在玻璃魚上使用netbeans運行我的項目,它工作正常,沒有在彈簧配置文件中的任何配置,但是當我嘗試使用湯姆貓時,我得到了同樣的問題 – user1861639