type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPGenerated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:6: package kjb.main does not exist
import kjb.main.DealString;
                ^
An error occurred at line: 20 in the jsp file: /1.1/index.jsp
Generated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:68: cannot find symbol
symbol  : class DealString
location: class org.apache.jsp._1_1.index_jsp
DealString ds = new DealString();
        ^
An error occurred at line: 20 in the jsp file: /1.1/index.jsp
Generated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:68: cannot find symbol
symbol  : class DealString
location: class org.apache.jsp._1_1.index_jsp
DealString ds = new DealString();
                            ^
3 errors org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

解决方案 »

  1.   

    这个是小弟在调式时出现的错误,请各位指导一下
      配置应该没有问题,应为我调试其他的jsp文件,都正常。。
      

  2.   

    <%@page language="java" contentType="text/html;charset=Gb2312"%>
    <%@page import="java.util.*,java.text.*,kjb.main.DealString"%>
    <jsp:useBean id="iEJB" scope="page" class="kjb2.library.bean.StoreBean"/>
    <%//define
    //TODO:  add some init defination here//end define DealString ds = new DealString();
    //取得菜单类别 //取得菜单类别
    String strType = ds.toString((String)request.getParameter("txt_type"));
    String strType1 = ds.toString((String)request.getParameter("txt_type1")); //编号
    String strID = ds.toString((String)request.getParameter("txt_id")); //增删改类型
    String strEdit = ds.toString((String)request.getParameter("txt_edit")); //是否搜索的
    String strSearch = ds.toString((String)request.getParameter("txt_search"));//新加入
    if(strSearch.equals("")) strSearch="0"; //增删改类型
    //Vector vect=new Vector(); if(strID.equals("")) strID="1";
    String bm = (String)request.getParameter("bm");
    if(bm==null || bm.equals("")) bm = "1";

    Vector vect=iEJB.getList(strID); String bgcolor="";

    %>
    <TABLE border=0 cellSpacing=1 class=p1 width="100%" class=tbg bgcolor="#8AA6F9">
                <TBODY>
                  <TR class=t2>
    <TD align=center><strong>索取号</strong></TD>
    <TD  align=center><strong>条码号</strong></TD>
    <TD  align=center><strong>馆藏</strong></TD>
    <TD  align=center><strong>书刊状态</strong></TD>
                  </TR><%
    for(int i=0;i<vect.size();i++){

    Hashtable hs=(Hashtable)vect.get(i);


    if ((i%2)==0) { 
    bgcolor="t3";
    }else {
    bgcolor="t4";
    }
    %> <TR class=<%=bgcolor%>>
    <TD align=middle noWrap ><span class="style7">
    <%=ds.toString( (String)hs.get("SQH") )%></a></span>
    </TD>
    <TD align=middle><span class="style7"><%=ds.toString( (String)hs.get("TMH") )%></span>&nbsp;</TD>
    <TD align=middle><span class="style7"><%=iEJB.toName("kjb2_kjxx_storeplace","STOREID","MC",ds.toString( (String)hs.get("STOREID") ) )%></span>&nbsp;</TD>

    <TD align=middle><span class="style7"><%=ds.toString( (String)hs.get("ZT") )%></span>&nbsp;</TD>
    </TR>
    <%}//end for%>


    </td></tr>
    </tbody></table><%iEJB.closeConn();%>  代码如上!!
      

  3.   

    index 的代码如下所示。。错误好像提示的是page import 的类不对。。怎么改呢?
    <%@page language="java" contentType="text/html;charset=GBK"%>
    <%@page import="kjb.main.DealString"%>
    <%
        DealString ds = new DealString();
    String strType = ds.toString(request.getParameter("txt_type"));
    String strType1 = ds.toString(request.getParameter("txt_type1"));
    String strID = ds.toString((String)request.getParameter("txt_id"));
    String strEdit = ds.toString((String)request.getParameter("txt_edit")); String strSearch = ds.toString((String)request.getParameter("txt_search"));//新加入 String childfile = "frame.jsp"; String uid = ds.toString((String)session.getAttribute("zgbh")); if(uid.equals(""))uid = "-1";%>
    <html>
    <head>
    <title>学校图书馆管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <link href="css/style.css" rel="stylesheet" type="text/css">
    <link href="css/main.css" rel="stylesheet" type="text/css"></head>
    <body bgcolor="#ffffff" topmargin=0 valign=top>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" >
    <tr><td>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" >
      <tr>
        <td width="486" background="images/banner_bg.jpg"><img src="images/banner.jpg" width="486" height="64"></td>
        <td background="images/banner_bg.jpg" align=center><a style="cursor:hand;color:#4D6FE6;" onclick="gomenu1('0')"><img src="images/icon3.gif" width="27" height="27" align="absmiddle" alt="首页"></a>&nbsp;&nbsp;<a style="cursor:hand;color:#4D6FE6;" onclick="window.history.back();"><img src="images/ARROW11.gif" width="24" height="21" align="absmiddle" alt="后退"></a>&nbsp;&nbsp;<a style="cursor:hand;color:#4D6FE6;" onclick="window.history.forward();"><img src="images/ARROW10.gif" width="24" height="21" align="absmiddle" alt="前进"></a>&nbsp;&nbsp;<!--<a style="cursor:hand;color:#4D6FE6;" onclick="gomenu1('-1')"><img src="images/icon1.gif" width="23" height="23" align="absmiddle" alt="重新登录"></a>&nbsp;&nbsp;--><a style="cursor:hand;color:#4D6FE6;" onclick="return windowclose();"><img src="images/icon2.gif" width="22" height="22" align="absmiddle" alt="退出"></a></td>
      </tr>
    </table><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="127"><img src="images/menu1.gif" width="127" height="32"></td>
        <td width="100%" valign="middle" background="images/menu_bg.gif" class=style3 align=center>
    </td>
        <td width="39"><img src="images/menu2.gif" width="39" height="32"></td>
      </tr>
    </table>
    </td></tr>
    <tr><td><form name=form1 action="index.jsp" method=post>
    <input type=hidden name="txt_type" value="<%=strType%>">
    <input type=hidden name="txt_type1" value="<%=strType1%>">
    <input type=hidden name="txt_id" value="<%=strID%>">
    <input type=hidden name="txt_edit" value="<%=strEdit%>">
    <input type=hidden name="txt_search" value="<%=strSearch%>">
    <input type=hidden name="txt_page" value="">
    <jsp:include page="<%=childfile%>"/>
    </td></tr></table>
    </form>
    <script>
    function windowclose()
    {
    if(confirm("您确定要退出系统吗?"))
    {
    window.close();
    return true;
    }
    return false;
    }
    function gomenu1(txt_type)
    {
    //var str="";
    //if(txt_type==2) str="?txt_type10=1&txt_edit1=";
    document.all.txt_type.value=txt_type;
    document.all.txt_type1.value="";
    document.all.txt_id.value="";
    document.all.txt_edit.value="";
    var strType = "<%=strType%>";
    var strType1 = "<%=strType1%>";
    document.all.form1.action="index.jsp";//+str
    document.all.form1.submit();
    }</script>
    </body>
    </html>
      

  4.   

    kjb.main.DealString
    确认一下这个包导的是否正确
      

  5.   

    symbol  : class DealString
    location: class org.apache.jsp._1_1.index_jsp
    DealString ds = new DealString();
            ^ 
      

  6.   

    Generated servlet error: 
    D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:6: package kjb.main does not exist 
    import kjb.main.DealString;根源在找不到 kjb.main 这个包