Hi all,
I'm just starting out with Spring AS and there's something that's puzzling me:
When you specify constructor arguments (via 'constructor-arg'), an instance of the class is initially created with all arguments set to 'null'. This instance is discarded and not returned by getObject(), so I'm not sure why it's being created in the first place.
This happens whether or not the instantiation is lazy or the class is defined as a singleton.
Here's some trace output from a test class constructor:
WithArgs constructor
Arg 1: null
Arg 2: null
WithArgs constructor
Arg 1: First constructor arg
Arg 2: Second constructor arg
Is there a reason for the first instantiation or is this a glitch in the system?
I'm really enjoying Spring AS, thanks for all the work!
- Nils.


Reply With Quote