XmlBeanFactory and NullPointerException
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:
And my beans.xml, placed in the same package is the following:
XmlBeanFactory factory = new XmlBeanFactory(new InputStreamResource(new FileInputStream("src/prueba/beans.xml")));
If you need my PruebaBean code too please tell me, but it's pretty simple...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<bean id="pruebaBean" class="prueba/PruebaBean" />
When I try to run this code I obtain the following (running in Eclipse):
Please I need an answer because I've tryied almost everything!!! thanks in advance!
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
... 1 more