急问:struts的action调用hibernate的DbOprate,出现错误?
现有一个
DbOperate的类,在用
main方法可以输出内容,如下:
public static void main(String[] args) {
// TODO Auto-generated method stub
DbOperate po =new DbOperate();
AdminUser p = po.getAdminUser( "manager ");
System.out.println(p.getPassword());
}
//此代码运行正常
//但在我以下的Action中同样调用上面的DbOperate
public final class LoginAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
//借助Hibernate进行数据库中相关的操作
DbOperate po =new DbOperate();//错误提示是这句
return (mapping.findForward( "toIndex "));//登陆成功
}
}
错误提示如下:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: org/hibernate/Session
com.lz.hibernate.LoginAction.execute(LoginAction.java:21)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
=====
不知问题出在啊里,请帮忙看看?谢谢。
[解决办法]
你的问题我还没遇到过,可能CSDN上的高手都跑了,以前那些传奇人物现在是一个也没见着...
我都快成传奇了....
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html