Cannot find the declaration of element 'beans' on the bean tag recursively

I am getting below error:

Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

my context.xml is as follows

<?xml version="1.0" encoding="UTF-8"?>

<beans default-autowire="no"
    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/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 
    http://www.springframework.org/schema/beans/spring-beans.xsd">

      <bean id="fileParser" class="com.xxx.xx.xx.oxm.FileInputParser" >
        <property name="unmarshaller" ref ="jaxb2Marshaller" />
    </bean>

    <bean id = "jaxb2Marshaller" class = "org.springframework.oxm.jaxb.Jaxb2Marshaller">
        <property name = "classesToBeBound">
            <array>
                <value>com.xxx.xx.xx.oxm.XutoxenPathInfo</value>
            </array>
        </property>
    </bean>

</beans>

Answers


Your schemaLocation is not written correctly. The location needs to follow the namespace name.

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-3.1.xsd">

Yours wasn't doing that. It was

beansNS 
contextNS 
contextLocation
beansLocation

Need Your Help

How to Delete Duplicate Rows in SQL 2000?

sql sql-server-2000

I thought I had this figured out but it turns out I'm just deleting the first record. The following returns the duplicate rows. All have a count of 2. I just want to delete the first one for each

Using PEAR to deploy a PHP web app?

deployment pear

Is it possible to package a PHP web app into PEAR format for automatic deployment? Like this: