Saturday, 21 November 2015

XML : spring error in xml controller

I'm writting a spring MVC project. I have the following servlet xml

   <?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: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.xsd   http://www.springframework.org/schema/context    http://www.springframework.org.schema/context/spring-context-4.2.3.xsd   http://www.springframework.org/schema/mvc    http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">   <mvc:annotation-driven />   <context:component-scan base-package="com.packt.webstore" />  <bean       class="org.springframework.web.servlet.view.InternalResourceViewResolver">   <property name="prefix" value="/WEB-INF/jsp/" />   <property name="suffix" value=".jsp" />          </bean>       </beans>    

This xml has a mistake. The error message is :

   Multiple annotations found at this line:     - schema_reference.4: Failed to read schema document     'http://www.springframework.org.schema/context/spring-   context-4.2.3.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the    document is not <xsd:schema>.  - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element    'context:component-scan'.    

jar versions are

  spring-webmvc-4.2.3  spring-context-4.2.3  spring-core-4.2.3  spring-web-4.2.3  spring-beans-4.2.3  spring-aop-4.2.3  spring-expression-4.2.3    

Could somebody help me to fix this error?

No comments:

Post a Comment