Topic: 找寻出错的原因 (JspServletWrapper.service) |
Print this page |
1.找寻出错的原因 (JspServletWrapper.service) | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-07 15:43 我的程序调试时,出现如下错误,找了半天也不知是哪错了,不知哪位大虾能给些意见,万分感谢。!! 错误: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:246) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497) at org.apache.jsp.printf_jsp._jspService(printf_jsp.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533) at java.lang.Thread.run(Thread.java:536) |
2.Re:找寻出错的原因 [Re: skyleon2004] | Copy to clipboard |
Posted by: why Posted on: 2004-08-07 19:05 show us your JSP source if possible. |
3.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-08 00:34 我在jsp页中调用了一个javabean 这个java bean通过hibernate改数据库 javabean中调用hibernate的方法如下: public void updateCat() { try { Session session=HibernateUtil.currentSession Transaction transaction; transaction = session.beginTransaction(); session.update(this); transaction.commit(); } catch (Exception he) { he.printStackTrace(); System.out.println("error:updateCat"); } finally { HibernateUtil.closeSession(); } } |
4.Re:找寻出错的原因 1 [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-08 00:36 jsp页中调用javabean如下: <jsp:useBean id="Cat" scope="page" class="mysql.Cat"/> <jsp:setProperty name="Cat" property="*" /> |
5.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-09 10:58 怎么没人回答呀?大家帮帮忙麻! |
6.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: why Posted on: 2004-08-10 03:01 skyleon2004 wrote: 1. It's less than two days. Everyone has his/her life to live. 2. At least I didn't have any clue with the very limited code snippet you showed us. What makes you think that they could be the source of the problem? 3. Which web server are you using? Have you tried the latest version? |
7.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-10 23:40 那我把源程序copy上来吧,请总斑竹大人帮看看好吗?谢谢。 pp.jsp文件 <%@ page language="java" contentType="text/html; charset=GBK" import="java.sql.*,mysql.*,java.util.*" %> <jsp:useBean id="Cat" scope="page" class="mysql.Cat"/> <jsp:setProperty name="Cat" property="*" /> <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title>Lomboz JSP</title> </head> <body bgcolor="#FFFFFF"> <% Cat.updateCat(); System.out.println("success"); %> </body> </html> Cat.java文件: package mysql; import java.util.*; import net.sf.hibernate.*; public class Cat { private int serialNo; private String title; private String speaker; private String content; public Cat() { } /** * @return */ public String getContent() { return content; } /** * @return */ public int getSerialNo() { return serialNo; } /** * @return */ public String getSpeaker() { return speaker; } /** * @return */ public String getTitle() { return title; } /** * @param string */ public void setContent(String Content) { content = Content; } /** * @param i */ public void setSerialNo(int SerialNo) { serialNo = SerialNo; } /** * @param string */ public void setSpeaker(String Speaker) { speaker = Speaker; } /** * @param string */ public void setTitle(String Title) { title = Title; } public void updateCat() { try { Session session=HibernateUtil.currentSession(); Transaction transaction; transaction = session.beginTransaction(); session.update(this); transaction.commit(); } catch (Exception he) { he.printStackTrace(); System.out.println("error:updateCat"); } finally { HibernateUtil.closeSession(); } } } |
8.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-10 23:43 HibernateUtil.java文件: package mysql; import net.sf.hibernate.*; import net.sf.hibernate.cfg.*; public class HibernateUtil { private static final SessionFactory sessionFactory; static { try { sessionFactory = new Configuration().configure().buildSessionFactory(); } catch (HibernateException ex) { throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage(), ex); } } public static final ThreadLocal session = new ThreadLocal(); public static Session currentSession() throws HibernateException{ Session s = (Session) session.get(); // Open a new Session, if this Thread has none yet if (s == null) { s = sessionFactory.openSession(); session.set; } return s; } public static void closeSession() { try { Session s = (Session) session.get(); session.set(null); if (s != null) s.close(); } catch(HibernateException e) { e.printStackTrace(); System.out.println("error:closeSession"); } } } |
9.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-11 00:04 再补充一下: 程序流程是aa.jsp->pp.jsp->Cat.java->hibernate.java aa.jsp如下: <%@ page language="java" contentType="text/html; charset=GBK" %> <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title>Lomboz JSP</title> </head> <body bgcolor="#FFFFFF"> <center> <h3>更新discuss表</h3> <form action="printf.jsp" method="post"> <input type="hidden" name="action" value="update"> 序列号<input type="text" name="serialNo" size="10"><br> 标 题<input type="text" name="title" size="10"><br> 发 言 人<input type="text" name="speaker" size="10"><br> 内 容<input type="text" name="content" size="10"><br> </center> <input type="submit" value="提交" > </body> </html> |
10.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-11 23:04 斑竹大人帮看看呀! |
11.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: zerol Posted on: 2004-08-11 23:10 你的Tomcat 版本是多少? |
12.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: buxing Posted on: 2004-08-12 16:26 Cat.java文件里的 HibernateUtil 你是从哪里来的啊? 你编译这个文件不会出错吗? |
13.Re:找寻出错的原因 (JspServletWrapper.service) [Re: skyleon2004] | Copy to clipboard |
Posted by: skyleon2004 Posted on: 2004-08-12 18:15 我的Tomcat是4.1的,这有问题吗? 这个hibernate没问题,可以通过编译的。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |