Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog


leave a comment »


I was setting up a Spring powered web application for testing.
I edited the configurations files (*.xml) to add in some new configuration for testing / POC.
The following error is shown when I deployed the WAR file in tomcat
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 40 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"":description, "":meta, "":constructor-arg, "":property, "":qualifier, "":lookup-method, "":replaced-method, WC[##other:""]}' is expected.

As highlighted above, there is error in the mentioned XML file.
After I opened the XML file, I found that is some missed-closed bean definition ABOVE the mentioned line (Line 40 in XML).
The error bean definition as below:

<bean id="accountManager" class="alfred.sandbox.AccountManager">

Added in a BLACK SLASH “/” to close the bean definition properly will solve the error:

<bean id="accountManager" class="alfred.sandbox.AccountManager"/>

Written by Alfred

September 15, 2011 at 17:40

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: