0
votes

Update :Now Working properly. Kindly follow the comments.
This is my Spring configuration file:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
    ">
    <context:component-scan  base-package="report.frontcontroller"/>
    <mvc:resources mapping="/resources/**" location="/resources/" />
    <mvc:annotation-driven />
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix"> <value>/WEB-INF/</value></property>
        <property name="suffix"> <value>.jsp</value></property>
    </bean>
</beans>

All jars are included in this project, and the configuration file is shown above. I get errors for this part:

<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />

Errors: * Matching wildcard is strict but no declaration is found for mvc:resource and mvc:annotation * Multiple annotations found at this line: - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources'. - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/mvc/spring- mvc-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . Multiple annotations found at this line:* - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:resources'. - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/mvc/spring- mvc.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

2
The configuration file itself is correct. What is your Spring (MVC) version?meskobalazs
Which spring jars do you have in your application?Ralph
its spring-webmvc-4.1.1.RELEASE-sources and all others jars are of same version too.user2677600
Now Running The problem was with the ips ie blocking the request for springframework.org/schema/mvc/spring-mvc.xsd file. There are two solutions for it either download it on local and include it on classpath or ask network engineer for not blocking the request.user2677600
This file is included in spring jars already. You most likely have a dependency issue in your project.Brian Clozel

2 Answers

0
votes

can you try below configuration that is copied from GIT - spring-mvc-showcase

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

    <resources mapping="/resources/**" location="/resources/" />

    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>

    <task:annotation-driven />

</beans:beans>
-1
votes

change to spring-mvc.xsd to spring-mvc-3.0.xsd .Similarly change at all the remaining places too.

Refer here

Edit

   <?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:mvc="http://www.springframework.org/schema/mvc"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan base-package="report.frontcontroller" />
    <mvc:annotation-driven/>
    <mvc:resources mapping="/resources/**" location="/resources/" /> 
   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/views/" />
      <property name="suffix" value=".jsp" />
   </bean>
</beans>