Can anyone help me with this issue? I am using Spring 1.1 RC2.
Tomcat 5.0 throws this SAXParseException when I deploy my Spring webapp.
My Tomcat is located in C:\Program Files\Apache Software Foundation\Tomcat 5.0Code:Aug 30, 2004 5:26:23 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from resource [/WEB-INF/applicationContext.xml] of ServletContext Aug 30, 2004 5:26:23 AM org.springframework.web.context.ContextLoader initWebApplicationContext SEVERE: Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML document from resource [/WEB-INF/applicationContext.xml] of ServletContext 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". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ...
My web.xml is as follows
My applicationContext.xml isCode:<?xml version="1.0" ?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <!-- Spring Configuration --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <!-- Spring Web --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ... </web-app>
Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!-- DAO definition --> <bean id="myUserDAO" class="com.mysite.user.dao.MockUnencryptedUserDAO" /> <!-- Business delegate configuration --> <bean id="UserManager" class="com.mysite.user.logic.UserManager"> <property name="userDAO"> <ref bean="myUserDAO"/> </property> </bean> </beans>


Reply With Quote