CDI deployment error: name WELD-001414 Bean is ambiguous

I have an application that has several modules and various dependencies. When I deploy the application to Glassfish 4, I get an error message:

org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean name is ambiguous. 
Name    JerseyClassAnalyzer resolves to beans: [Managed Bean [class org.glassfish.jersey.internal.inject.JerseyClassAnalyzer] 
with qualifiers [@Default @Named @Any], Managed Bean 
[class org.glassfish.jersey.internal.inject.JerseyClassAnalyzer] 
with qualifiers [@Default @Named @Any]]

What could be the reason? I already saw topics about this, and the solution was to edit the annotation, but this is not mine EJB, but just a dependency. How can I avoid this exception?

I am using Java EE 6 with JDK 1.7 and Glassfish 4.0.

+4
source share
3 answers

Glassfish , , provided Maven pom.xml, docs.

<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0</version>
    <scope>provided</scope>
</dependency>

- , .

<dependency>
    <groupId>org.glassfish.jersey.containers</groupId>
    <artifactId>jersey-container-servlet</artifactId>
    <version>2.4.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-client</artifactId>
    <version>2.4.1</version>
    <scope>provided</scope>
</dependency>
+5

EAR. , , .

+1

, @Named bean .

-1

All Articles