当前位置: 技术问答>java相关
急需指点
来源: 互联网 发布时间:2015-10-03
本文导语: 我的环境是win2000server+apache1.3.22+tomcat4.0.1 我写了一个jsp文件,放到了tomcat webappsroot 还写了一个bean(connecdata.class 内容是关于jdbc) 放到了tomcat webappsrootweb-infcalssdatabase 运行时报以下错误,请大家指点 //////////////...
我的环境是win2000server+apache1.3.22+tomcat4.0.1
我写了一个jsp文件,放到了tomcat webappsroot
还写了一个bean(connecdata.class 内容是关于jdbc) 放到了tomcat webappsrootweb-infcalssdatabase
运行时报以下错误,请大家指点
/////////////////////////////////////begin
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
--------------------------------------------------------------------------------
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:66: Class database.connecdata not found.
database.connecdata pSQL = null;
^
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:69: Class database.connecdata not found.
pSQL= (database.connecdata)
^
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:74: Class database.connecdata not found.
pSQL = (database.connecdata) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "database.connecdata");
^
An error occured between lines: 9 and 27 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:99: Undefined variable or class name: rsdm
out.println(rsdm.getColumnLable(i));
^
An error occured between lines: 9 and 27 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:100: Undefined variable or class name: rsdm
out.println(rsdm.getColumnTypeName(i));
^
5 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
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:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
at java.lang.Thread.run(Unknown Source)
/////////////////////////////////////////////////end
我写了一个jsp文件,放到了tomcat webappsroot
还写了一个bean(connecdata.class 内容是关于jdbc) 放到了tomcat webappsrootweb-infcalssdatabase
运行时报以下错误,请大家指点
/////////////////////////////////////begin
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
--------------------------------------------------------------------------------
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:66: Class database.connecdata not found.
database.connecdata pSQL = null;
^
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:69: Class database.connecdata not found.
pSQL= (database.connecdata)
^
An error occurred at line: 7 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:74: Class database.connecdata not found.
pSQL = (database.connecdata) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "database.connecdata");
^
An error occured between lines: 9 and 27 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:99: Undefined variable or class name: rsdm
out.println(rsdm.getColumnLable(i));
^
An error occured between lines: 9 and 27 in the jsp file: /test.jsp
Generated servlet error:
C:Tomcat401worklocalhost_test$jsp.java:100: Undefined variable or class name: rsdm
out.println(rsdm.getColumnTypeName(i));
^
5 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
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:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
at java.lang.Thread.run(Unknown Source)
/////////////////////////////////////////////////end
|
class connecdata{
改成
public class connecdate{
记得这个"public"可以让jsp访问到这个bean
这个问题我也遇到过
改成
public class connecdate{
记得这个"public"可以让jsp访问到这个bean
这个问题我也遇到过