spring UnsatisfiedDependencyException

Posted on 2011-04-19
Last Modified: 2012-05-11
>>>In case of any ambiguity in ‘byType’ or ‘constructor’ mode, an UnsatisfiedDependencyException will be thrown.

I was reading above lines at
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.
Question by:gudii9
    LVL 20

    Accepted Solution

    Simiar answer for similar question :)

    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 :
    LVL 92

    Assisted Solution

    Its just saying if it cannot determine which bean to autwire then it throws that exception
    eg. if using byType and there are two beans of the required type. In this case it has no way to know what to use so it throws UnsatisfiedDependencyException
    LVL 20

    Assisted Solution

    by:Sathish David Kumar N
    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 ...

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now