Hi all,
What is the problem with this xml?
*<?xml version='1.0" encoding="UTF-8"?>*
*<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"*
*"http://www.springframework.org/dtd/spring-beans.dtd">*
*<beans>*
* <bean id="hello" class="helloimpl">*
* <property name="greeting">*
* <value> Good Morning!....... </value>*
* <property>*
* *
* </bean>*
*</beans>*
{code}
I am getting the following message:-
*Error : org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 14 in XML document from class path resource [hello.xml] is invalid; nested exception is org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.*
Here is the code with calls the above xml.
{code}
import java.io.*;
import org.springframework.beans.factory.*;
import org.springframework.beans.factory.xml.*;
import org.springframework.core.io.*;
public class helloclient{
public static void main (String args[])throws Exception
{
try
{
System.out.println("Ranjoo...you will get it..");
Resource res = new ClassPathResource("hello.xml");
BeanFactory factory = new XmlBeanFactory(res);
hello bean1 = (hello)factory.getBean("hello");
String s = bean1.sayhello(args[0]);
System.out.println(s);
}
catch(Exception e)
{
System.out.println(" Error : "+ e);
}
}
}
{code}
Advance thanx,
ranjith.