补充下:
把action里的createQuery("from student as c");
改成createQuery("from comm.test1.Student as c");错误依旧。Student类确实确实的在comm.test1包里。student.hbm.xml文件里是这样写的:
<hibernate-mapping>
<class name="comm.test1.Student" table="STUDENT" schema="SYSTEM">
<id name="id" type="java.lang.Long">
<column name="ID" precision="10" scale="0" />
<generator class="increment" />
</id>
<property name="stuNo" type="java.lang.String">
<column name="STU_NO" length="10" />
</property>
<property name="stuName" type="java.lang.String">
<column name="STU_NAME" length="10" />
</property>
</class>
</hibernate-mapping>Student类是这样的:package comm.test1;
import org.apache.struts.action.ActionForm;public class Student extends ActionForm implements java.io.Serializable {
// Fields private Long id;
private String stuNo;
private String stuName;
// Constructors /** default constructor */
public Student() {
}
/** full constructor */
public Student(String stuNo, String stuName) {
this.stuNo = stuNo;
this.stuName = stuName;
}
// Property accessors public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
} public String getStuNo() {
return this.stuNo;
}
public void setStuNo(String stuNo) {
this.stuNo = stuNo;
} public String getStuName() {
return this.stuName;
}
public void setStuName(String stuName) {
this.stuName = stuName;
}
兄弟们 帮帮小弟吧。
把action里的createQuery("from student as c");
改成createQuery("from comm.test1.Student as c");错误依旧。Student类确实确实的在comm.test1包里。student.hbm.xml文件里是这样写的:
<hibernate-mapping>
<class name="comm.test1.Student" table="STUDENT" schema="SYSTEM">
<id name="id" type="java.lang.Long">
<column name="ID" precision="10" scale="0" />
<generator class="increment" />
</id>
<property name="stuNo" type="java.lang.String">
<column name="STU_NO" length="10" />
</property>
<property name="stuName" type="java.lang.String">
<column name="STU_NAME" length="10" />
</property>
</class>
</hibernate-mapping>Student类是这样的:package comm.test1;
import org.apache.struts.action.ActionForm;public class Student extends ActionForm implements java.io.Serializable {
// Fields private Long id;
private String stuNo;
private String stuName;
// Constructors /** default constructor */
public Student() {
}
/** full constructor */
public Student(String stuNo, String stuName) {
this.stuNo = stuNo;
this.stuName = stuName;
}
// Property accessors public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
} public String getStuNo() {
return this.stuNo;
}
public void setStuNo(String stuNo) {
this.stuNo = stuNo;
} public String getStuName() {
return this.stuName;
}
public void setStuName(String stuName) {
this.stuName = stuName;
}
兄弟们 帮帮小弟吧。
将antlr-2.7.5H3.jar拷贝到D:\bea\weblogic90\server\lib下面
修改了D:\bea\user_projects\domains\dev\bin\startWebLogic.cmd在set CLASSPATH前加了
set PRE_CLASSPATH=D:\bea\weblogic90\server\lib\antlr-2.7.5H3.jar;
在set CLASSPATH后加了
set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
可运行还是抛出org.hibernate.hql.ast.HqlToken [from student as c] 没改成。晕
ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from student as c]
从这一句,就看出来错误是什么了。
没找到类嘛,student改为Student