【发布时间】:2016-03-23 20:37:16
【问题描述】:
我的项目使用 Spring MVC 作为前端,使用 EJB 作为后端。当我使用jackson序列化和反序列化控制器级波纹管代码中的json字符串时,代码工作正常但服务层给出错误“class file for com.fasterxml.jackson.core.JsonParseException not found”
ObjectMapper mapper = new ObjectMapper();
Object convertedObject = mapper.readValue(jsonString, class);
我的模块 pom 文件包含依赖项。
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.3.0</version>
</dependency>
创建对象后,mapper 出现此错误。
错误:Error:(247, 67) java: cannot access com.fasterxml.jackson.core.JsonParseException
class file for com.fasterxml.jackson.core.JsonParseException not found
【问题讨论】:
标签: java json maven spring-mvc jackson