mavenjakarta-eewildfly-10picketlink

Bean name is ambiguous when adding a new dependency


I added this picketlink dependency in my pom file :

 <dependency>
        <groupId>org.picketlink</groupId>
            <artifactId>picketlink</artifactId>
        <version>2.7.1.Final</version>
    </dependency>

I am getting this error :

WELD-001414: Bean name is ambiguous. Name dsWindowContext resolves to beans

The dependency i am adding is an UberJar, that has Deltaspike JAR in it, which is causing a conflict, since apparently Deltaspike is already imported inside my project, but i can't find in my pom.xml.

I am using Wildfly 10, JEE 7, Picketlink 2.7, how can i delete Deltaspike and where can i find it ?


Solution

  • It is always problematic to add an uber jar as dependency, but I cannot always be avoided.

    To find Deltaspike in your project, you can use dependency:tree. It shows you all the positions where Deltaspike is included.

    The easiest way to get rid of it at runtime is to declare it as provided in your dependencyManagement section.

    More correct would be to find all the places in the dependency tree where the artifact is included and exclude it from all the places. This also eliminates the artifact at compile time.