所以我按照本教程video(source) 创建Java企业Web应用程序并遇到了问题。因为这是我第一次使用这样的东西对我来说,我对如何解决这个问题一无所知。
尝试运行项目时,我收到一条错误消息"该模块尚未部署。有关详细信息,请参阅服务器日志。"经过一段时间试图找出问题所在,我认为这很可能是我在" Student.java" -class中出现的错误。它说"找不到符号classTable。创建子类创建测试类"。这可能是什么问题?我不确定哪些代码是相关的,因为我是一个完全的初学者,但我的所有文件都是源代码的精确副本。这是Student.java:
package com.joseph.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author Joseph
*/
@Entity
@Table
@NamedQueries({@NamedQuery(name="Student.getAll",query="SELECT e FROM Student e")})
public class Student implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column
private int studentId;
@Column
private String firstname;
@Column
private String lastname;
@Column
private int yearLevel;
public int getStudentId() {
return studentId;
}
public void setStudentId(int studentId) {
this.studentId = studentId;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public int getYearLevel() {
return yearLevel;
}
public void setYearLevel(int yearLevel) {
this.yearLevel = yearLevel;
}
public Student(int studentId, String firstname, String lastname, int yearLevel) {
this.studentId = studentId;
this.firstname = firstname;
this.lastname = lastname;
this.yearLevel = yearLevel;
}
public Student(){}
}