henry lu
Sep 1st, 2004, 01:53 PM
I have two bean definition files: datasource_beans.xml and app_beans.xml
and I place these file names in the web.xml file and start web app
server, it works fine.
But, when I place the code in the program for junit testing, I got the
errors:
org.springframework.beans.factory.BeanDefinitionSt oreException: Line 68
in XML document from file
[C:\devel\webapps\awards\WEB-INF\app_beans.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: An element with the
identifier "dataSource" must appear in the document.
java.lang.NullPointerException
org.springframework.beans.factory.BeanDefinitionSt oreException: Line 68
in XML document from file
[C:\devel\webapps\awards\WEB-INF\app_beans.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: An element with the
identifier "dataSource" must appear in the document.
Here is my code:
org.springframework.context.ApplicationContext ctx = null;
String[] paths = {"/WEB-INF/datasource_beans.xml",
"/WEB-INF/app_beans.xml"};
ctx = new FileSystemXmlApplicationContext(paths);
why?
-Henry
and I place these file names in the web.xml file and start web app
server, it works fine.
But, when I place the code in the program for junit testing, I got the
errors:
org.springframework.beans.factory.BeanDefinitionSt oreException: Line 68
in XML document from file
[C:\devel\webapps\awards\WEB-INF\app_beans.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: An element with the
identifier "dataSource" must appear in the document.
java.lang.NullPointerException
org.springframework.beans.factory.BeanDefinitionSt oreException: Line 68
in XML document from file
[C:\devel\webapps\awards\WEB-INF\app_beans.xml] is invalid; nested
exception is org.xml.sax.SAXParseException: An element with the
identifier "dataSource" must appear in the document.
Here is my code:
org.springframework.context.ApplicationContext ctx = null;
String[] paths = {"/WEB-INF/datasource_beans.xml",
"/WEB-INF/app_beans.xml"};
ctx = new FileSystemXmlApplicationContext(paths);
why?
-Henry