I try to inject an ObjectMapper using fasterXML jackson like this:
@Inject
private ObjectMapper objectMapper;
but i have the next error when i try to deploy the war file:
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type ObjectMapper with qualifiers @Default
This are my dependencies:
<!-- the core, which includes Streaming API, shared low-level abstractions (but NOT data-binding) -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-2-version}</version>
</dependency>
<!-- Just the annotations; use this dependency if you want to attach annotations
to classes without connecting them to the code. -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-2-version}</version>
</dependency>
<!-- databinding; ObjectMapper, JsonNode and related classes are here -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-2-version}</version>
</dependency>
<!-- jackson-dataformat-yaml: Support for reading and writing YAML-encoded data via Jackson abstractions -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson-2-version}</version>
</dependency>
What i did wrong?