Tôi đang sử dụng JsonNode để lấy dữ liệu từ bất kỳ loại định dạng jason và lưu trữ nó để MongoDB Nhưng trong khi lấy dữ liệu từ mongoDB nó là ném lỗi như dưới đây.Không thể nhanh chóng com.fasterxml.jackson.databind.node.ObjectNode sử dụng constructor NO_CONSTRUCTOR với lập luận Trong MongoDB
Failed to instantiate com.fasterxml.jackson.databind.node.ObjectNode using constructor NO_CONSTRUCTOR with arguments
Dưới đây là lớp tên miền của tôi
public class Profiler {
@Id
private String id;
@Field("email")
private String email;
@Field("profiler")
private Map<String,JsonNode> profiler;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Map<String, JsonNode> getProfiler() {
return profiler;
}
public void setProfiler(Map<String, JsonNode> profiler) {
this.profiler = profiler;
}
public Profiler(String email,Map<String,JsonNode> profiler){
this.email=email;
this.profiler = profiler;
}
@JsonCreator
public Profiler(@JsonProperty("_id")String id,@JsonProperty("email")String email,@JsonProperty("profiler")Map<String,JsonNode> profiler){
this.id=id;
this.email=email;
this.profiler = profiler;
}
public Profiler(String id){
this.id=id;
}
public Profiler(Map<String,JsonNode> profiler){
this.profiler = profiler;
}
public Profiler(){
}
}
public interface ProfilerRepository extends MongoRepository<Profiler, String>{
public Profiler findOneByEmail(String email);
}
Và cuộc gọi điều khiển của tôi là như dưới đây và tôi nhận được lỗi trên dòng này.
Profiler profile=profileService.findOneByEmail(email);
Bạn có thể hiển thị tài liệu mongo của mình không? – notionquest