| Author |
Error: Bean property 'userDAO' is not writable or has an invalid setter method.
|
vikas sharmaa
Ranch Hand
Joined: Jun 28, 2007
Posts: 191
|
|
i am getting below wiring error while trying to integrate Spring 3 with hibernate. I followed this site vaannila
here is my code:
userService defined in dispatcher-servlet.xml:
myUserDAO defined in dispatcher-servlet.xml:
UserServiceImpl class:
UserDAOImpl class:
please let me know, where i am going wrong. thank you.
|
 |
vikas sharmaa
Ranch Hand
Joined: Jun 28, 2007
Posts: 191
|
|
|
please some expert respond to my query. or do i need to provide more code. please help.
|
 |
vikas sharmaa
Ranch Hand
Joined: Jun 28, 2007
Posts: 191
|
|
|
please, anybody here to help me out. Thank you.
|
 |
Lorand Komaromi
Ranch Hand
Joined: Oct 08, 2009
Posts: 276
|
|
|
Remove the @Autowired annotation from userDAO (you're specifying explicitly the dependency with the property tag...), and add a public setter for userDAO!
|
OCJP 6 (93%)
|
 |
vikas sharmaa
Ranch Hand
Joined: Jun 28, 2007
Posts: 191
|
|
Thank you very much Lonard, its now working after removing the Autowired!
But, I have a confusion. I am explicitly specifying the dependency of userService bean also with the property tag. And am able to Autowired userService bean as shown below:
Please guide me, why Autowired annotation is working here. Thank you.
|
 |
 |
|
|
subject: Error: Bean property 'userDAO' is not writable or has an invalid setter method.
|
|
|