2014-10-06 98 views
0

我试图用Spring 4和Jackson实现一个Web服务。 当我部署我收到此以下错误的应用程序:无法找到XML名称空间的Spring NamespaceHandler [http://www.springframework.org/schema/mvc

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc] 
Offending resource: class path resource [namaservlet-servlet.xml] 

这是我namaservlet-context.xml中:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:mvc="http://www.springframework.org/schema/mvc" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd 
     http://www.springframework.org/schema/mvc 
     http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd"> 

    <mvc:annotation-driven> 
    <mvc:message-converters> 
     <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> 
     <property name="objectMapper"> 
      <bean class="utils.HibernateAwareObjectMapper" /> 
     </property> 
     </bean> 
    </mvc:message-converters> 
    </mvc:annotation-driven> 

</beans> 

我怎样才能解决这个问题呢?

感谢

回答

2

的stracktrace表明你缺少你的classpath spring-webmvc罐子。添加它,它应该工作正常

+0

谢谢!就是这样 – andreybavt 2014-10-06 19:52:59

相关问题