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.
LVL 7
gudii9Asked:
Who is Participating?
 
Amitkumar PConnect With a Mentor Sr. 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
 
objectsConnect With a Mentor Commented:
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 NConnect With a Mentor ArchitectCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.