JSP + Tomcat 5.5 + SQL Server 2000 出错,始终找不到原因,帮忙看一下
首先是我的环境变量: classpath :.;D:\Java\jdk1.6.0_18\lib\tools.jar;D:\Java\jdk1.6.0_18\lib\dt.jar
JAVA_HOME : D:\Java\jdk1.6.0_18
Path : D:\Java\jdk1.6.0_18\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\Microsoft SQL Server\80\Tools\BINN
我的Tomcat 路径是:C:\Program Files\Apache Software Foundation\Tomcat 5.5
我把整个代码包括Jsp和Java所有的文件都放在文件夹 Code 里;
Code的路径是 : C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myapp\Code
Code里除了有些JSP和html文件外还有三个文件夹:admin(里面放着JSP文件)、WEB-INF(此文件夹中有一个classes文件夹 ,classes文件夹中包括comm和 Information文件夹,这两个文件夹中放着java文件)和images(里面是图片)。
我在浏览器地址栏中输入:http://localhost:9090/myapp/Code/index.jsp
出现错误:
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: Unable to compile class for JSP:
An error occurred at line: 42 in the jsp file: /Code/admin/InfoComm.jsp
User cannot be resolved to a type
39: public String getName(String Userid)throws Exception
40: {
41: try{
42: User o_user = new User();
43: o_user.setUserId(Userid);
44: if(o_user.getUser())
45: {
An error occurred at line: 30 in the jsp file: /Code/left.jsp
Categories cannot be resolved to a type
27: //如果是管理员,则可以设置用户信息,如果是其他用户则可以更改自己的密码
28: // 定义用户对象
29: Vector v_Cate = new Vector();
30: Categories o_Cate = new Categories();
31: v_Cate = o_Cate.getMoreCategories();
32: for(int i=0;i <v_Cate.size();i++)
33: {
An error occurred at line: 34 in the jsp file: /Code/left.jsp
Categories cannot be resolved to a type
31: v_Cate = o_Cate.getMoreCategories();
32: for(int i=0;i <v_Cate.size();i++)
33: {
34: o_Cate = (Categories)v_Cate.elementAt(i);
35: %>
36: <tr> <td align="center"> <a href="infoList.jsp?cid= <%=o_Cate.getCateId()%>" target="main" style="text-decoration: none"> <%=o_Cate.getCateTitle()%> </a> </td> </tr>
37: <% }%>
Stacktrace:
org.apache.(DefaultErrorHandler.java:93)
org.apache.(ErrorDispatcher.java:330)
org.apache.(JDTCompiler.java:451)
org.apache.(Compiler.java:319)
org.apache.(Compiler.java:298)
org.apache.(Compiler.java:286)
org.apache.jasper.(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.28
下面我将把其中几个文件贴上来,大家帮忙分析一下到底是哪里的问题或错误,谢谢!
[ 本帖最后由 bigpeach 于 2010-2-11 22:28 编辑 ]