我尝试使用 fastXML jackson 注入 ObjectMapper,如下所示:
@Inject
private ObjectMapper objectMapper;
但是当我尝试部署war文件时出现下一个错误:
org.jboss.weld.exceptions.DeploymentException: WELD-001408:带有限定符 @Default的类型ObjectMapper的依赖关系不满足
这是我的依赖项:
<!-- 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>
我做错了什么?