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:
And my beans.xml, placed in the same package is the following:Code: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...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>
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!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


Reply With Quote
