Spring doesn't parse jndi variables default values to match the expected-type [SPR-11039] #15667
Please see forum post for description.
Juergen Hoeller commented
This was indeed a limitation that I've fixed for 4.0 RC2 and 3.2.5, explicitly converting a given default value to the desired target type if it isn't assignable right away.
Note that this was primarily a problem with the String-based XML namespace. With a raw JndiObjectFactoryBean, you could pass a specifically typed object into the "defaultObject" property.