Issue 1:
Ben Greenway opened SPR-4704 and commented

An exception occurred when using the factory-method call.

2008-04-15 16:54:18,854 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed

java.lang.NullPointerException

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.getCacheKey(AbstractAutoProxyCreator.java:322)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.predictBeanType(AbstractAutoProxyCreator.java:245)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:531)

at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1174)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:303)

at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:948)

at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:702)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:378)

The debugger was run with a conditional breakpoint placed in the class AbstractAutowireCapableBeanFactory at line 530 with the condition "beanClass==null".

This allowed us to identify the offending config. (The reduced) Bean config was:

<property name="receiptTypeControlAccountMap">

<map>

<entry><key><ref bean="receiptTypePremiumResearch"/></key><ref bean="controlAccountPremium"/></entry>

</map>

</property>

<bean name="receiptTypePremiumResearch" class="com.jdv.stockhighway.journal.types.ReceiptType" factory-method="valueOf">

<constructor-arg><value>PREMIUM_RESEARCH</value></constructor-arg>

</bean>

This problem may be averting by using (the better) use of <util:constant static-field= ie.

<property name="receiptTypeControlAccountMap">

<map>

<entry>

<key><util:constant static-field="com.jdv.stockhighway.journal.types.ReceiptType.PREMIUM_RESEARCH" /></key>

<ref bean="controlAccountPremium"/>

</entry>

But unsure why this is an issue with 2.5.3 and was OK with all previous 2.5 releases (2.5, 2.5.1 and 2.5.2).

Other information:

ReceiptType is a Java enum class and does not override the valueOf method.

public enum ReceiptType implements Serializable {

PREMIUM_RESEARCH("P", "Premium Research", "Premium Research"),

ALERTS("A", "Alerts service", "Alerts service"),

Affects: 2.5.3

Issue Links:

#9360 NullPointerException in org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator ("duplicates")

Issue 2:
Jasper Rosenberg opened SPR-1129 and commented

The problem is that if you have a bean A that has a constructor argument that expects to be expanded by a PropertyPlaceholderConfigurer, but use A as a factory bean to create bean B, A appears to be constructed before the PropertyPlaceholderConfigurer ever gets a chance to expand A's constructor parameters.

The attached simple unit test demonstrates the problem. It works against 1.2.1 but not 1.2.2

Affects: 1.2.2

Attachments:

spring-ut.zip (1.24 kB)

Issue Links:

#5820 AbstractBeanFactory.getType change dramatically alters bean instantiation order ("duplicates")