|
From: <jue...@we...> - 2004-12-23 18:22:48
|
Indeed, that's a bug that unfortunately slipped into 1.1.3. The issue = has already been fixed in CVS; feel free to give a nightly 1.1.4-dev = snapshot a try (http://www.springframework.org/downloads/nightly). =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Rolf Kulemann Gesendet: Do 23.12.2004 19:01 An: spr...@li... Betreff: [Springframework-developer] Factory bean created with factory = method throws NullPointerException since 1.1.3 Hi list, I developed a small app using Spring 1.1.1, 1.1.2 and now 1.1.3. Since 1.1.3 some test of my app fail. You can download a test case to reproduce this with Spring 1.1.3 from http://www.apache.org/~roku/spring-factory-beans-test.zip . Just add the sources to the Spring test folder and run the test(s). I want to give a small overview of the problem: bean config: <beans> <bean id=3D"peopleFactory" class=3D"org.springframework.beans.PeopleFactoryImpl" factory-method=3D"getInstance"/> <bean id=3D"person" class=3D"org.springframework.beans.Person" factory-bean=3D"peopleFactory" factory-method=3D"getPerson"/> =20 </beans> Getting the first bean via BeanFactory is no problem. Getting the second bean is not working in 1.1.3 anymore. I debugged the Spring sources a bit and the problem really seems to be a bug. The offending statement is in class AbstractAutowireCapableBeanFactory line 381: for (int i =3D 0; i < factoryClass.getMethods().length; i++) { The variable factoryClass is null, since the method getType(..) invoked in line 372 returns null. Please see that method for further details. Looking at this class in Spring 1.1.2 shows the difference. Unfortunately I have no patch available. Maybe it isnt' a bug anyway. Please have a look. Thanks and I wish a happy new new year. -- Rolf Kulemann ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |