0

I have recently migrated my web app to Spring 3.2.3. recently when trying to resolve static pages issue I came across mvc:resources namespace. But,I am getting the error in application context.xml file. I have searched a lot but could not solve the issue.Please help. I am using My Eclipse 8.6 and Tomcat 6.

Please note that control+space suggests mvc:resources.but as soon as i use, it throws Cannot locate BeanDefinitionParser for element [resources]

Tried to use schema with an explicit version also. I have pasted relevant code

 <?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" 
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"

        xsi:schemaLocation="
                http://www.springframework.org/schema/beans 
                http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                http://www.springframework.org/schema/context 
                http://www.springframework.org/schema/context/spring-context-3.2.xsd
                http://www.springframework.org/schema/mvc
                http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
                http://www.springframework.org/schema/aop 
                http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
                http://www.springframework.org/schema/tx 
                http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

    <mvc:resources location="" mapping=""/>

</beans>
beinghuman
  • 2,088
  • 7
  • 27
  • 36

1 Answers1

0

Make sure that you have to correct jars on your classpath, make sure that spring-webmvc.jar is on the classpath. When using Maven (or Gradle) make sure that you have a single (and correct) version of that jar on your classpath. Multiple versions can conflict.

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • corect jars are in the classpath and i am not using build tool. – beinghuman Aug 26 '13 at 06:07
  • Judging the exception there is something not correct with your classpath. Where do you get the exception? In STS or on deployment? – M. Deinum Aug 26 '13 at 07:31
  • i get error message in the eclipse itself as soon as i write this namespace in applicationcontext.xml file. – beinghuman Aug 26 '13 at 09:20
  • you mean all the jars which are present in src?sry for asking – beinghuman Aug 26 '13 at 09:35
  • No the actual classpath in use by Eclipse. The fact that a jar file is somewhere on the filesystem doesn't mean it is getting used by Eclipse. (I would strongly suggest you start to use [Maven](http://maven.apache.org) or [Gradle](http://www.gradle.org) for your dependencies, saves you a lot of pain and searching for jars.) – M. Deinum Aug 26 '13 at 09:39
  • Okay I have located the class path but i am using user libraries so jars present in user library will not be visible to you.So how do i provide data to you? – beinghuman Aug 26 '13 at 10:07
  • I was looking at my Spring downloads and found the folder named Schema which contains all xsd.So how can I include a particular xsd in my project and where should i put it? – beinghuman Aug 27 '13 at 16:35
  • following this post http://stackoverflow.com/questions/901242/why-cant-eclipse-resolve-the-spring-dwr-schema I have added the 3.2xsd but still no resoluion – beinghuman Aug 27 '13 at 16:52
  • The xsds are included in the jar files and by tapping into the XSD loading mechanism are loaded from there. That is if you have the jars in your classpath (and no conflicting jars either). Next to that adding the xsds isn't going to help because it cannot find classes (making me believe you mis jars in your classpath). – M. Deinum Aug 27 '13 at 17:52