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!
I've found the cause for this problem. I had to declare the super class as
abstract. I assume that by this the Weld class scanner ignores the super class as being a managed bean and therefore does not conflict with all inheriting SLSBs anymore.