标题:神阿,救救我吧;大哥们,拉我一把吧.急死我了.为何总出错.
取消只看楼主
myeric
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-12-26
 问题点数:0 回复次数:3 
神阿,救救我吧;大哥们,拉我一把吧.急死我了.为何总出错.

下面是出错信息,如果可能,一会儿我把源文件全部发上去

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: 6 in the jsp file: /car.jsp

Generated servlet error:
    [javac] Compiling 1 source file

C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:7: cannot resolve symbol
symbol  : class Car 
location: package testclass
import testclass.Car;
                 ^
C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:49: cannot resolve symbol
symbol  : class Car 
location: package testclass
 testclass.Car car2=new testclass.Car();
          ^



An error occurred at line: 6 in the jsp file: /car.jsp

Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:49: cannot resolve symbol
symbol  : class Car 
location: package testclass
 testclass.Car car2=new testclass.Car();
                                 ^
3 errors


	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
	org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.


搜索更多相关主题的帖子: 大哥 信息 message request ffffff 
2005-12-31 11:21
myeric
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-12-26
得分:0 
好的,我试一下,随后把源文件发上去,谢谢大哥们了
2005-12-31 13:58
myeric
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-12-26
得分:0 

哥哥们,还是不行呀,我还是把源码全部发上去吧

2005-12-31 14:48
myeric
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-12-26
得分:0 

11111111下面这一段是Car类文件源码:

package testclass;
import java.util.*;
import java.io.*;
public class Car implements Serializable
{ Hashtable list=new Hashtable();
String item="Welcome!";
int mount=0;
String unit=null;
public void Car()
{ }
public void setItem(String newItem)
{ item=newItem;
}
public void setUnit(String newUnit)
{ unit=newUnit;
}
public void setMount(int m)
{ mount=m;
}
public void 添加商品到购物车()
{ String str="Name: "+item+" Mount:"+mount+" Unit:"+unit;
list.put(item,str);
}
public Hashtable 列出购物车中的商品()
{ return list;
}
public void 删除货物(String s)
{ list.remove(s);
}
}




22222222下面是名为car.jsp的JSP页:

<%@ page contentType="test/html;charset=GB2312"%>
<%@ page import="java.util.*"%>
<%@ page import="testclass.Car"%>
<HTML>
<BODY ><Font size=5>
<% testclass.Car car2=new testclass.Car();%>
<P>这里是第一百货商场,选择您要购买的商品添加到购物车:
<% String str=response.encodeRedirectURL("add.jsp");
%>
<FORM action="<%=str%>" method=post name=form>
<Select name="item" value="没选择">
<Option value="TV">电视机
<Option value="apple">苹果
<Option value="coke">可口可乐
<Option value="milk">牛奶
<Option value="tea">茶叶
</Select>
<P>输入购买的数量:
<Input type=text name="mount">
<P>选择计量单位:
<INPUT type="radio" name="unit" value="个">个
<INPUT type="radio" name="unit" value="公斤">公斤
<INPUT type="radio" name="unit" value="台">台
<INPUT type="radio" name="unit" value="瓶">瓶
<Input type=submit value="提交添加">
</FORM>
<P>您的购物车有如下商品:
<% Hashtable list=car2.列出购物车中的商品();
Enumeration enum=list.elements();
while(enum.hasMoreElements())
{ String goods=(String)enum.nextElement();
byte b[]=goods.getBytes("ISO-8859-1");
goods=new String(b);
out.print("<BR>"+goods);
}
%>
<% String str1=response.encodeRedirectURL("selectRemovedGoods.jsp");
%>
<FORM action="<%=str1%>" method=post name=form>
<Input type=submit value="修改购物车中的货物">
</FORM>
</FONT>
</BODY>
</HTML>


3333333下面是运行名为car.jsp的JSP页后出现的错误提示



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: 6 in the jsp file: /car.jsp

Generated servlet error:
    [javac] Compiling 1 source file

C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:7: cannot resolve symbol
symbol  : class Car 
location: package testclass
import testclass.Car;
                 ^
C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:49: cannot resolve symbol
symbol  : class Car 
location: package testclass
 testclass.Car car2=new testclass.Car();
          ^



An error occurred at line: 6 in the jsp file: /car.jsp

Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\myweb\org\apache\jsp\car_jsp.java:49: cannot resolve symbol
symbol  : class Car 
location: package testclass
 testclass.Car car2=new testclass.Car();
                                 ^
3 errors


	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
	org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.


请大哥们帮忙了.
2005-12-31 14:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-41072-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.155653 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved