JSP项目开发全程实录第八章问题
发表在JavaWeb图书答疑 2010-05-08
是否精华
版块置顶:
HTTP Status 500 - 
________________________________________
type Exception report
message 
description The server encountered an internal error () that prevented it from fulfilling this request.
exception 
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 26

23: </tr>
24: </table>
25: <table width="778" height="158" border="0" align="center" cellpadding="0" cellspacing="0" background="Images/login_mid.jpg">
26: <html:form action="manage/student.do?action=login" method="post" focus="ID" onsubmit="return check(studentForm)">
27: <tr>
28: <td>
29: 


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause 
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.index_jsp._jspService(index_jsp.java:124)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause 
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57)
org.apache.struts.taglib.html.FormTag.<clinit>(FormTag.java:93)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:126)
org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:136)
org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.
________________________________________
Apache Tomcat/6.0.13



第26句:
<html:form action="manage/student.do?action=login" method="post" focus="ID" onsubmit="return check(studentForm)">




控制台错误如下
严重: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57)
at org.apache.struts.taglib.html.FormTag.<clinit>(FormTag.java:93)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:126)
at org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:136)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)







然后我新建了一个WEB工程test,把08章的index.jsp拷贝到test下的WebRoot下面,加入了struts,调试后如下:
页面错误:
HTTP Status 500 - 
________________________________________
type Exception report
message 
description The server encountered an internal error () that prevented it from fulfilling this request.
exception 
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /manage/student
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause 
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /manage/student
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.index_jsp._jspService(index_jsp.java:124)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause 
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /manage/student
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:759)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:147)
org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.

控制台提示:
Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /manage/student
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:759)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
at org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:147)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
我用的MyEclipse 6.5 SqlServer 2000打了sp4补丁 jdk1.6安装后把bin目录已添加到path中,javac亦可通过。我是做C的,没做过Javaweb的程序,感觉很多问题。这是我的毕业设计,现在是干着急,感觉你们那使用说明很简单,按步骤好像每个例子都不能用。不知道为什么,有详细的步骤吗?忘能尽快回复,是不是一些配置还是标签或包的问题啊,你们这些都调试过吗?望尽快恢复。

还有你们这个程序可以打包吗?可以打成jar吗?能发一封过来吗?
邮箱:liwc.sky@gmail.com
分享到:
精彩评论 6
绿草_mrkj
学分:0 LV1
2010-05-08
沙发
  首先我可以很负责的对读者说,我们图书中的程序是经过严格测试的,只要你按照光盘使用说明说中的配置,附加数据库是不会出现问题的,本书给的程序,是发布到tomcat下的程序,用户将其放置到服务器下,在lib下放置程序需要的Jar包,就可以运行。
小小邪
学分:0 LV1
2010-05-08
板凳
[FIELDSET][LEGEND]引自:1楼[/LEGEND]
  首先我可以很负责的对读者说,我们图书中的程序是经过严格测试的,只要你按照光盘使用说明说中的配置,附加数据库是不会出现问题的,本书给的程序,是发布到tomcat下的程序,用户将其放置到服务器下,在lib下放置程序需要的Jar包,就可以运行。
[/FIELDSET]

补充:
  把dbcp。collections等类库放到Tomcat服务器的类库文件夹中,否则Tomcat无法创建数据源,也就是数据库连接池。
角落里的绽放
学分:0 LV1
TA的每日心情
@
2023-10-17 21:53:22
2010-05-08
地板
我是把08文件夹拷贝到与root平行了啊,还要怎么?
角落里的绽放
学分:0 LV1
TA的每日心情
@
2023-10-17 21:53:22
2010-05-08
4L
<html:form action="manage/student.do?action=login" method="post" focus="ID" onsubmit="return check(studentForm)">
说这行有错,是不是struts的问题,我是从myeclipse直接倒进去的。
角落里的绽放
学分:0 LV1
TA的每日心情
@
2023-10-17 21:53:22
2010-05-08
5L
应该是source问题,帮忙看下了,急啊。
柠檬草
学分:0 LV1
2010-05-10
6L
需要在程序的lib文件夹下放置程序需要的Jar包
首页上一页 1 下一页尾页 6 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照