File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

loading error in application context file

 
anoopsingh it
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am facing issue into the loading the applicationcontext.xm file.

<?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
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<bean id="test" class="test.Test" init-method="init">
<property name="resource"><value>classpath:test2.txt</value></property>
<property name="fichier"><value>classpath:test.txt</value></property>
</bean>

</beans>

when i am loading this file container is throwing this error.

INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 6 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".


can anyone give suggestion reagrding this error.

Thanks
Anoop
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Spring are you using. If it isn't Spring 2.0 you would get that error because

http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">;

in your schemaLocation.

Try removing the "-2.0" part and see if that works. If that doesn't fix it, then you are missing the Spring jars in your classpath.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic