PicoContainer
  1. PicoContainer
  2. PICO-278

AmbiguousComponentResolutionException not printing component key within VerifyingVisitor

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I had a set of components I was running the VerifyingVisitor on and was getting the exception:

      org.picocontainer.PicoVerificationException: [org.picocontainer.defaults.AmbiguousComponentResolutionException: null has ambiguous dependency on interface java.util.Map, resolves to multiple classes: [class com.genfw.command.wrappers.impl.DefaultAttributeMap, class com.genfw.command.servlet.impl.DefaultEnteredValues]]

      at org.picocontainer.defaults.VerifyingVisitor.traverse(VerifyingVisitor.java:56)

      at com.genfw.command.servlet.impl.NoWebServerServiceLocatorFactoryTestCase.testGetLocator(NoWebServerServiceLocatorFactoryTestCase.java:28)

      The problem I have is that the original component key causing the problem wasn't being included in the stack trace. Putting a break point at VerifyingVisitor 76:
      try

      { componentAdapter.verify(currentPico); }

      catch (RuntimeException e)

      { nestedVerificationExceptions.add(e); }

      and grabbing a componentAdapter.toString() in my debugger nabbed the real culprint:

      [CachingCA delegate=org.picocontainer.defaults.ConstructorInjectionComponentAdapter[interface com.genfw.command.wrappers.ParameterSource]]

      I believe the suspect is probably the AmbiguousComponentResolutionException's getMessage() since the key printed in the stack trace is null – but it could be in the code throwing the AmbiguousComponentResolutionException.

        People

        • Assignee:
          Unassigned
          Reporter:
          Michael Rimov
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated: