2 ybabyrjm YBabyRjm 于 2014.10.19 15:48 提问

使用hibernate和servlet时报错

使用hibernate4.1.4时报出java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion的错误,这个包我已经已经引进去了,调用的servlet如下
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    CustomersDAO customer = new CustomersDAO();
    Customers list = customer.findById(1l);
    System.out.println(list.getName());
    out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
    out.println("<HTML>");
    out.println("  <HEAD><TITLE>A Servlet</TITLE></HEAD>");
    out.println("  <BODY>");
    out.print("    This is ");
    out.print(this.getClass());
    out.println(", using the GET method");
    out.println("  </BODY>");
    out.println("</HTML>");
    out.flush();
    out.close();
}

在非web情形下能运行通过,求大神解释

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!