eclipse下開發struts+hibernate出現的問題!
下面是個action,我設定斷點來跟蹤程式,發現當執行action裡面的execute()方法時,執行到HelloForm helloForm = (HelloForm) form;這句話後就出現了異常!我不知道原因,請指點,謝謝!異常為:
java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion
com.itfly.struts.action.HelloAction.execute(HelloAction.java:52)
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)
action為:
package com.itfly.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Query;
import org.hibernate.Session;
import com.itfly.base.BaseUserDAO;
import com.itfly.dao.UserDAO;
import com.itfly.dao._RootDAO;
import com.itfly.struts.form.HelloForm;
public class HelloAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
HelloForm helloForm = (HelloForm) form;
// TODO Auto-generated method stub
_RootDAO.initialize();
UserDAO userDAO = new UserDAO();
Session session = userDAO.getSession();
Query hql = session.createQuery("from User where Id=1");
List list = hql.list();
System.out.print(list.size());
request.setAttribute("list",list);
return mapping.findForward("success");
}
}
java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion
com.itfly.struts.action.HelloAction.execute(HelloAction.java:52)
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)
action為:
package com.itfly.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Query;
import org.hibernate.Session;
import com.itfly.base.BaseUserDAO;
import com.itfly.dao.UserDAO;
import com.itfly.dao._RootDAO;
import com.itfly.struts.form.HelloForm;
public class HelloAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
HelloForm helloForm = (HelloForm) form;
// TODO Auto-generated method stub
_RootDAO.initialize();
UserDAO userDAO = new UserDAO();
Session session = userDAO.getSession();
Query hql = session.createQuery("from User where Id=1");
List list = hql.list();
System.out.print(list.size());
request.setAttribute("list",list);
return mapping.findForward("success");
}
}
相關文章
- 請教Eclipse下開發JSP小問題EclipseJS
- 貪食蛇專案開發出現的問題。
- 小弟在struts+hibernate的開發中遇到難題。求救!!
- 在jbuilder中開發ejb出現的問題求救!UI
- 用Eclipse 開發Spring Hibernate問題EclipseSpring
- eclipse出現jvm terminated exit code=1問題[轉]EclipseJVM
- Eclipse下開發js薦EclipseJS
- Eclipse初次java開發問題總結-4-Maven使用問題彙總EclipseJavaMaven
- eclipse下開發winform的外掛WindowBuilderEclipseORMUI
- 版主,下載學習中,出現問題
- 急問:mysql出現的問題MySql
- 在eclipse中進行php開發中文亂碼問題EclipsePHP
- Web 開發中的檔案下載問題Web
- mac osx下django-admin.py出現的問題MacDjango
- 操作oracle出現的問題Oracle
- 效能問題往往出現在開發人員可控範圍之外
- 新MacBook Pro問題頻發 可能是顯示卡出現問題Mac
- Eclipse下搭建Android的NDK開發環境EclipseAndroid開發環境
- 解決64位的Eclipse 啟動時,找不到jvm.dll的問題和Eclipse中出現亂碼的問題EclipseJVM
- 解決eclipse編輯jsp、js檔案時,經常出現卡死的問題EclipseJS
- eclipse+lomboz+jboss開發疑問(新手)Eclipse
- Java操作hdfs出現的問題Java
- nginx 編譯出現的問題Nginx編譯
- oracle安裝出現的問題Oracle
- mysql 安裝出現的問題MySql
- 發現問題,解決問題
- Eclipse的一個傻問題Eclipse
- Eclipse開發:瞭解RCP應用的實現Eclipse
- Windows下Eclipse工程移到Linux下亂碼問題解決WindowsEclipseLinux
- 我的Eclipse出大問題啦!不能顯示HTML啊!求救!EclipseHTML
- appfuse2.0.2在eclipse下的開發和使用APPEclipse
- Win10系統下BATTLETECH出現問題的解決方法Win10BAT
- linux下啟動監聽器出現問題的解決Linux
- Android NDK開發之旅15 NDK Eclipse下NDK開發流程AndroidEclipse
- 用jb+jboss+oracle開發cmp出問題Oracle
- eclipse應用問題Eclipse
- 在Eclipse下搭建Android開發環境EclipseAndroid開發環境
- Ubuntu下解決Eclipse無法輸入中文問題UbuntuEclipse