I don\'t want to create a default constructor for my auditRecord
class.
But Spring seems to insist on it:
org.springframework.beans.fact
No, you are not required to use default (no arg) constructors.
How did you define your bean? It sounds like you may have told Spring to instantiate your bean something like one of these:
Where you did not provide a constructor argument. The previous will use default (or no arg) constructors. If you want to use a constructor that takes in arguments, you need to specify them with the constructor-arg
element like so:
If you want to reference another bean in your application context, you can do it using the ref
attribute of the constructor-arg
element rather than the val
attribute.