1 Reply Latest reply on Nov 13, 2010 6:36 PM by widura

    AmbiguousResolutionException when managed beans use inheritance

    widura

      Hello,


      I am getting a AmbiguousResolutionException saying WELD-001318 Cannot resolve an ambiguous dependency between. Then all managed classes are enumerated. The classes are a session bean annotated with @Stateless which inherits from a normal class which is declared as managed wiithin the exception. Seems like this is the cause for the ambiguity. Since the SLSB inherits from a normal class, this normal class is somehow seen as managed by WELD too. And when I am not using inheritance I don't get this exception.


      So what can I do if I still want to rely on a super class with all common functionalty encapsulated to be used in my SLSBs?


      For the sake of completeness: I got this error when I extended the project with JAX-RS logic. It seems that this inclusion triggers another scan for managed beans by Weld. Before incorporating JAX-RS I already used Weld facilities like the @Inject annotation.


      Thanks in advance!
      Widura