Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd'

Tags:

spring

schema

While starting my Spring App, I am getting the following error :

WARNING: Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document     
'http://www.springframework.org/schema/beans/spring-beans-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 <xsd:schema>.

My springapp-servlet.xml is as follows :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        
xmlns:aop="http://www.springframework.org/schema/aop"      
xsi:schemaLocation="http://www.springframework.org/schema/beans   
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean name="/hello.htm" class="springapp.web.HelloController"/>
</beans>

Please suggest.

like image 221
Umeshwali Avatar asked Sep 07 '12 10:09

Umeshwali


1 Answers

When I got this error message, it was merely because of a missing jar in my CLASSPATH. Some spring applications seem to be very hungry for spring jars. My app wound up needing all of these on the classpath:

${OTS_DIR}/org.springframework.aop-${VERSION}.jar:\
${OTS_DIR}/org.springframework.aspects-${VERSION}.jar:\
${OTS_DIR}/com.springsource.org.aopalliance-${AOPALLIANCE_VER}.jar:\
${OTS_DIR}/org.springframework.asm-${VERSION}.jar:\
${OTS_DIR}/org.springframework.beans-${VERSION}.jar:\
${OTS_DIR}/org.springframework.context-${VERSION}.jar:\
${OTS_DIR}/org.springframework.core-${VERSION}.jar:\
${OTS_DIR}/org.springframework.expression-${VERSION}.jar:\
${OTS_DIR}/org.springframework.jdbc-${VERSION}.jar:\
${OTS_DIR}/org.springframework.jms-${VERSION}.jar:\
${OTS_DIR}/org.springframework.orm-${VERSION}.jar:\
${OTS_DIR}/org.springframework.transaction-${VERSION}.jar:\
${OTS_DIR}/org.springframework.instrument-${VERSION}.jar
like image 52
Ogre Psalm33 Avatar answered Sep 19 '22 01:09

Ogre Psalm33