• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

spring ‘auto-wire’ and ‘dependency-check’ feature together

>>>It’s always good to combine the ‘auto-wire’ and ‘dependency-check’ feature together to make sure the property is auto-wire successfully.


I was reading above lines at
http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/
I did not understand clearly. What is UnsatisfiedDependencyException. when do we get it. I usually see that in my application.
Any ideas, resources,sample code,links,  highly appreciated. thanks in advance.
0
gudii9
Asked:
gudii9
3 Solutions
 
Amitkumar PSr. ConsultantCommented:
Please refer the API, it says "Exception thrown when a bean depends on other beans or simple properties that were not specified in the bean factory definition, although dependency checking was enabled."

Refer : http://static.springsource.org/spring/docs/2.0.5/api/org/springframework/beans/factory/UnsatisfiedDependencyException.html
0
 
gudii9Author Commented:
>>>What is UnsatisfiedDependencyException. when do we get it. I usually see that in my application.

this part of the question is mistyping. Please ignore it.
what I mean to ask actually is

>>>It’s always good to combine the ‘auto-wire’ and ‘dependency-check’ feature together to make sure the property is auto-wire successfully.


I was reading above lines at
http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/
I did not understand clearly



please advise
0
 
objectsCommented:
dependency-check specifies how dependencies are checked. When using autowiring it is a good idea to set so a check is done to see that all your dependencys are met.

If you don't have it then you could have depencies not set without you knowing it
0
 
Sathish David Kumar NCommented:
Normally autowire is false in your bean creation in the applicationContext.xml file ...  its defaulty take it by no ....

so while your wiring you will mention that which class can be wiried ..

but if you use autowire=true meansthen you can use no, byName,byType,constructor,autodetct
while using this ur not correct wired means then you will get that error !!


Check the link for more reffrencess ... http://www.springindepth.com/book/in-depth-ioc-autowiring.html 

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now