Spring Config file -


i using spring 3.1.0 version. getting error while deployment due dispatcher-servlet.xml. here code using:

<?xml version="1.0" encoding="utf-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"       xsi:schemalocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">     <context:component-scan base-package="com.mycompany.cart" />      <bean         class="org.springframework.web.servlet.view.internalresourceviewresolver">         <property name="prefix">             <value>/web-inf/pages/</value>         </property>         <property name="suffix">             <value>.jsp</value>         </property>     </bean>  </beans> 

error :

 error occurred during deployment: exception while loading app : java.lang.illegalstateexception: containerbase.addchild: start: org.apache.catalina.lifecycleexception: org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 5 in xml document servletcontext resource [/web-inf/mvc-dispatcher-servlet.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 5; columnnumber: 93; cvc-elt.1: cannot find declaration of element 'beans'.. please see server.log more details. 

i tried find correct bean file not succeeded. can guys please advise should search config file per spring version.

seems missing namespace context , schema location declarations wrong

try

<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"       xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">     <context:component-scan base-package="com.mycompany.cart" />      <bean         class="org.springframework.web.servlet.view.internalresourceviewresolver">         <property name="prefix">             <value>/web-inf/pages/</value>         </property>         <property name="suffix">             <value>.jsp</value>         </property>     </bean>  </beans> 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -