《错误集--殷晓燕.doc》由会员分享,可在线阅读,更多相关《错误集--殷晓燕.doc(7页珍藏版)》请在金锄头文库上搜索。
1、1.HTTP Status 500 -type Exception reportmessagedescription The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: java.lang.NullPointerExceptionorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
2、pper.java:500)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)com.test.s
3、ervlet.LoginServlet.doPost(LoginServlet.java:73)javax.servlet.http.HttpServlet.service(HttpServlet.java:637)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)com.test.filter.LoginFilter.doFilter(LoginFilter.java:30)root causejava.lang.NullPointerExceptionorg.apache.jsp.userlist_jsp._jspSer
4、vice(userlist_jsp.java:95)错误分析:空指针解决方法:登录成功之后应跳转到servlet中,再到页面2. 错误信息:java.lang.NullPointerExceptioncom.sun.action.UserAction.execute(UserAction.java:20)错误分析:userAction文件中值没有传入execute中,且在execute中输出list时,不会输出list解决方法:private UserService userService实例化3. 错误信息:在登录时必须在session中放入一个值,不然就会进行拦截(即刚开始运行时就会要求你
5、在首先登录)。错误分析:说明在刚开始登录时,session中没有值,因此登录也进行了拦截,则需要将登录的页面排除在外解决方法:添加代码,将登录页面排除在外if(LoginAction.class = invocation.getAction().getClass()System.out.println(1111111);return invocation.invoke();4.在服务器中:java.lang.NullPointerExceptioncom.osim.persistence.dao.Impl.DeptDaoImpl.addDept(DeptDaoImpl.java:18)com.
6、osim.service.Impl.DeptServiceImpl.addDept(DeptServiceImpl.java:20)com.osim.struts.actions.dept.DeptAction.addDept(DeptAction.java:18)在console中出现:org.hibernate.MappingNotFoundException: resource: com/osim/beans/Tdept.hbm.xml not foundat org.hibernate.cfg.Configuration.addResource(Configuration.java:6
7、10)原因:Tdept.hbm.xml找不到解决方法:包写错了,应为com/osim/beans/xml/Tdept.hbm.xml5. HTTP Status 500 - type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception java.lang.NoSuchMethodException: com.osim.struts.actions.dept.DeptActio
8、n.listDept()java.lang.Class.getMethod(Class.java:1605)原因:listDept() 方法找不到解决方法:查看struts_dept.xml中method的属性是否为listDept()6.java.lang.NullPointerExceptioncom.osim.struts.actions.dept.DeptAction.getDeptid(DeptAction.java:32)解决方法:private Tdept dept=new Tdept();实例化 7. type Exception reportmessage descripti
9、on The server encountered an internal error () that prevented it from fulfilling this request.exception java.lang.RuntimeException: java.lang.NullPointerExceptioncom.osim.struts.interceptor.HibernateSessionInterceptor.intercept(HibernateSessionInterceptor.java:40)com.opensymphony.xwork2.DefaultActio
10、nInvocation.invoke(DefaultActionInvocation.java:248)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.ap
11、ache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)root cause java.lang.NullPointerExceptioncom.osim.struts.action.position.PositionAction.addPositionExecute(PositionAction.java:20)sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12、解决方法:private PositionService positionService=BeanFactory.getBeanImpl(PositionService.class);(即要实例化,相当于private PositionService positionService=new PositionServiceImpl()8. HTTP Status 500 - type Exception reportmessage description The server encountered an internal error () that prevented it from fulf
13、illing this request.root cause java.lang.IllegalArgumentException: id to load is required for loadingorg.hibernate.event.LoadEvent.(LoadEvent.java:74)org.hibernate.event.LoadEvent.(LoadEvent.java:56)解决方法:修改要用struts标签9. HTTP Status 500 - type Exception reportmessage description The server encountered
14、 an internal error () that prevented it from fulfilling this request.exception Unable to instantiate Action, com.osim.struts.action.title.TitleAction, defined for addTitle in namespace /nullcom.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:318)com.opensymphony
15、.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:399)com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:198)org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)o