我在使用Jeddic时如何解析http 500

时间:2017-06-09 02:08:40

标签: java plugins

我在NetbeansIDE8.2中编写了一个安静的界面,我在chorme中使用PostMan App进行了调试,然后出现异常情况我将在此处显示图像: the HTTP ERROR 500

我的代码在这里,我已经将arryList返回给浏览器

@Path("/getStu")
@GET
public List<TfFreshstudent> queryStudentNoDomitory()
{
    List<TfFreshstudent> studentList= cq.queryFreshstudentNoDomitory();
    if (studentList.isEmpty()) {
        return studentList;
    }
    return null;
}

我已经尝试了自动创建代码的其他子,并且错误也发生了:

 @GET
public List<TfDormitory> getAllTfDormitories() {
    log.debug("REST request to get all TfDormitories");
    List<TfDormitory> tfDormitories = tfDormitoryFacade.findAll();
    return tfDormitories;
}

我认为可能是返回类型错误,也许ArryList无法在浏览器上显示,也许我必须将其解析为json类型或响应

1 个答案:

答案 0 :(得分:0)

这是Jeddic创建的实体

package com.freshV3.cart.model;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "tf_dormitory")
public class TfDormitory {
@Column(name = "id", table = "tf_dormitory", nullable = false, length = 22)
@Id
private String id;

@Column(name = "buildName", table = "tf_dormitory", length = 50)
@Basic
private String buildName;

@Column(name = "comment", table = "tf_dormitory")
@Basic
private String comment;

@Column(name = "freshStudentId", table = "tf_dormitory", length = 22)
@Basic
private String freshStudentId;

@Column(name = "isDelete", table = "tf_dormitory")
@Basic
private Integer isDelete;

@Column(name = "operator", table = "tf_dormitory", length = 20)
@Basic
private String operator;

@Column(name = "roomCode", table = "tf_dormitory", length = 32)
@Basic
private String roomCode;

@Column(name = "roomId", table = "tf_dormitory")
@Basic
private String roomId;

public String getId() {
    return this.id;
}

public void setId(String id) {
    this.id = id;
}

public String getBuildName() {
    return this.buildName;
}

public void setBuildName(String buildName) {
    this.buildName = buildName;
}

public String getComment() {
    return this.comment;
}

public void setComment(String comment) {
    this.comment = comment;
}

public String getFreshStudentId() {
    return this.freshStudentId;
}

public void setFreshStudentId(String freshStudentId) {
    this.freshStudentId = freshStudentId;
}

public Integer getIsDelete() {
    return this.isDelete;
}

public void setIsDelete(Integer isDelete) {
    this.isDelete = isDelete;
}

public String getOperator() {
    return this.operator;
}

public void setOperator(String operator) {
    this.operator = operator;
}

public String getRoomCode() {
    return this.roomCode;
}

public void setRoomCode(String roomCode) {
    this.roomCode = roomCode;
}

public String getRoomId() {
    return this.roomId;
}

public void setRoomId(String roomId) {
    this.roomId = roomId;
}

}