小编Arv*_*rma的帖子

无法读取 HTTP 消息:org.s.HttReadableException:无法读取文档:无法识别的令牌“PUT”:正在等待(“true”、“false”或“null”)

我正在 Spring STS 中实现 SPRING 数据 JPA+ Oracle...它是邮递员中的示例应用程序,我收到 Get 方法的响应 200,但对于 post 和 put 无法从数据库读取数据,我猜并给出以下错误 -

无法读取 HTTP 消息:org.springframework.http.converter.HttpMessageNotReadableException:无法读取文档:无法识别的令牌“PUT”:在 [来源:java.io. PushbackInputStream@1f1076e7; 行:1,列:5];嵌套异常是 com.fasterxml.jackson.core.JsonParseException:无法识别的标记“PUT”:在 [来源:java.io.PushbackInputStream@1f1076e7; 处期待(“true”、“false”或“null”);行:1,列:5]

@Service
public class PersonService {
    @Autowired
    private PersonRepository personRepository;


    public Object findAll() {
        return personRepository.findAll();
    }

    public Person findById(Long id) {
        return personRepository.findOne(id);
    }

    public Person save(Person person) {
        return personRepository.save(person);
    }


    public Person delete(Person person) {
        personRepository.delete(person);
        return person;
    }

    public Person findByEmail(String email){ return null; }
}
Run Code Online (Sandbox Code Playgroud)

控制器方法:

@RequestMapping(value = "/all", method = …
Run Code Online (Sandbox Code Playgroud)

rest spring spring-data-jpa

3
推荐指数
1
解决办法
2953
查看次数

标签 统计

rest ×1

spring ×1

spring-data-jpa ×1