XmlBeanFactory and NullPointerException
Hi,
I'm pretty new with Spring, and I'm trying to start with my very first example but I can't get it working, my code is the following in the main method:
Code:
XmlBeanFactory factory = new XmlBeanFactory(new InputStreamResource(new FileInputStream("src/prueba/beans.xml")));
And my beans.xml, placed in the same package is the following:
Code:
<?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="pruebaBean" class="prueba/PruebaBean" />
</beans>
If you need my PruebaBean code too please tell me, but it's pretty simple...
When I try to run this code I obtain the following (running in Eclipse):
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
at prueba.PruebaApp.main(PruebaApp.java:28)
Caused by: java.lang.NullPointerException
at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:104)
... 1 more
Please I need an answer because I've tryied almost everything!!! thanks in advance!