Unable to compile class for JSP找不出错误

烤鱼想睡觉 2012-07-29 03:51:31
显示是ClassNotFoundException: org.apache.jsp.BBS.WebRoot.article_jsp
Unable to compile class for JSP:
的错误 可是就是不知道哪错了 找不出来!!


<%@ page pageEncoding="Gb18030"%>
<%@ page import="java.sql.*, org.hjj.bbs.*, java.util.*"%>

<%!
private void tree(List<Article> articles , Connection conn , int id , int grade){
String sql = "select * from article where pid =" + id;
Statement stmt = DB.createStmt(conn);
ResultSet rs = DB.executeQuery(stmt , sql);
try{
while(rs.next()){
Article a = new Article();
a.initFromRs(rs);
a.setGrade(grade);
articles.add(a);
if(!a.isLeaf()){
tree(articles , conn , a.getId() , grade+1);
}
}
}catch(SQLException e){
e.printStackTrace();
}
finally {
DB.close(rs);
DB.close(stmt);
}
}
%>

<%
List<Article> articles = new ArrayList<Article>();
Connection conn = DB.getConn();
tree(articles,conn,0,0);
DB.close(conn);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>论坛: Java语言*初级版</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="images/style.css">
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="1%">
<a href="http://bbs.chinajavaworld.com/index.jspa">;ti<img
src="images/header-left.gif" alt="JAVA中文世界论坛|JAVA开发者论坛"
border="0" height="38" width="199"> </a>
</td>
<td width="98%">
<img src="images/header-stretch.gif" alt="" border="0" height="38"
width="100%">
</td>
<td width="1%">
<img src="images/header-right.gif" alt="" border="0" height="38"
width="5">
</td>
</tr>
</tbody>
</table>
<br>
<p class="jive-page-title">
论坛: Java语言*初级版
</p>
<p class="jive-description">
 
</p>
<link rel="alternate" type="application/rss+xml" title="RSS"
href="http://bbs.chinajavaworld.com/rss/rssmessages.jspa?forumID=20">
<script language="JavaScript" type="text/javascript"
src="images/common.js"></script>
<div id="jive-forumpage">
<div class="jive-buttons">
<table summary="Buttons" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="jive-icon">
<a
href="http://bbs.chinajavaworld.com/post%21default.jspa?forumID=20"><img
src="images/post-16x16.gif" alt="发表新主题" border="0" height="16"
width="16"> </a>
</td>
<td class="jive-icon-label">
<a id="jive-post-thread"
href="http://bbs.chinajavaworld.com/post%21default.jspa?forumID=20">发表新主题</a>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<input name="dateRange" value="last90days" type="hidden">
<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr valign="top">
<td>
<nobr>
帖子: 152,709
</nobr>
-
<nobr>
主题: 37,048
</nobr>
-
<nobr>
过滤:
<select size="1" class="jive-selbox"
onChange="location.href=options[selectedIndex].value;">
<option selected="selected"
value="forumfilter.jspa?forumID=20&start=0&filter=all">
所有主题
</option>
<option
value="forumfilter.jspa?forumID=20&start=0&filter=open">
未解决的问题
</option>
<option
value="forumfilter.jspa?forumID=20&start=0&filter=answered">
已解决的问题
</option>
<option value="forum.jspa?forumID=20&start=0&isBest=1">
精华区
</option>
</select>
</nobr>
-
<span class="nobreak"> 页数: 1,482 - <span
class="jive-paginator"> [ <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=0&isBest=0"
class="jive-current">1</a> <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=25&isBest=0"
class="">2</a> <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=50&isBest=0"
class="">3</a> <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=75&isBest=0"
class="">4</a> <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=100&isBest=0"
class="">5</a> | <a
href="http://bbs.chinajavaworld.com/forum.jspa?forumID=20&start=25&isBest=0">下一页</a>
] </span> </span>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr valign="top">
<td width="99%">
<div class="jive-thread-list">
<div class="jive-table">
<table summary="List of threads" cellpadding="0"
cellspacing="0" width="100%">
<tbody>
<tr class="jive-even"></tr>
</tbody>
<thead>
<tr>
<th class="jive-first" colspan="3">
主题
</th>
<th class="jive-author">
<nobr>
作者  
</nobr>
</th>
<th class="jive-view-count">
<nobr>
查看  
</nobr>
</th>
<th class="jive-msg-count" nowrap="nowrap">
回复
</th>
<th class="jive-last" nowrap="nowrap">
最后发表
</th>
</tr>
</thead>
<tbody>
<%
for(Iterator<Article> it = articles.iterator(); it.hasNext();){
Article a = it.next();
String preStr = "";
for(int i=0; i<a.getGrade(); i++){
preStr += "----";
}
%>
<tr class="jive-odd">
<td class="jive-first" nowrap="nowrap" width="1%">
<div class="jive-bullet">
<img src="images/read-16x16.gif" alt="读" border="0"
height="16" width="16">
<!-- div-->
</div>
</td>
<td nowrap="nowrap" width="1%">
   
</td>
<td class="jive-thread-name" width="99%">
<img src="images/ico_top.gif" align="absmiddle">
<img src="images/ico_best.gif" align="absmiddle">
<a id="jive-thread-2"
href="article_detail.jsp?id=<%=a.getId()%>"><%=preStr + a.getTitle()%></a>
</td>
<td class="jive-author" nowrap="nowrap" width="1%">
<span class=""> <a
href="http://bbs.chinajavaworld.com/profile.jspa?userID=28627">gift</a>
</span>
</td>
<td class="jive-view-count" width="1%">
3,178
</td>
<td class="jive-msg-count" width="1%">
8
</td>
<td class="jive-last" nowrap="nowrap" width="1%">
<div class="jive-last-post">
<%=new java.text.SimpleDateFormat("yyy-MM-dd HH:mm:ss").format(a.getPdate())%>
<br>
最后发表:
<a
href="http://bbs.chinajavaworld.com/thread.jspa?messageID=1083864#1083864"
title="crab1" style="">crab1 »</a>
</div>
</td>
</tr>
<%
}
%>

<tbody>
</tbody>
</table>
</div>
</div>
<div class="jive-legend"></div>
</td>
<td width="1%">
i
<!-- END sidebar box 'POPULAR TAGS' -->
</td>
</tr>
</tbody>
</table>
</div>
<table id="jive-footer" border="0" cellpadding="6" cellspacing="0"
width="100%">
<tbody>
<tr>
<td>
<a href="http://bbs.chinajavaworld.com/index.jspa">Forum Home</a>
|
<a href="http://bbs.chinajavaworld.com/login%21default.jspa">Login
/ Register</a> |
<a href="http://bbs.chinajavaworld.com/account%21input.jspa">Create
Account</a> |
<a href="http://bbs.chinajavaworld.com/search%21default.jspa">Search</a>
<br>
<a href="http://www.chinajavaworld.com/" target="_blank"><b><font
color="red">C</font> </b>hina<b><font color="green">J</font> </b>ava<b><font
color="blue">W</font> </b>orld.com</a> 
<script src="images/stat.php" language="JavaScript"></script>
<script src="images/cnzz_core.php" charset="utf-8"
type="text/javascript"></script>
<a href="http://www.cnzz.com/stat/website.php?web_id=2632601"
target="_blank" title="站长统计"><img src="images/pic1.gif"
border="0" hspace="0" vspace="0"> </a>
<script src="images/stat_002.php" language="JavaScript"></script>
<script src="images/cnzz_core_002.php" charset="utf-8"
type="text/javascript"></script>
<a href="http://www.cnzz.com/stat/website.php?web_id=2632614"
target="_blank" title="站长统计"><img src="images/pic1.gif"
border="0" hspace="0" vspace="0"> </a>
</td>
</tr>
</tbody>
</table>
</body>
</html>
...全文
2026 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jackson_fighting 2012-08-01
  • 打赏
  • 举报
回复
JRE问题? 楼主是不是导入进来的项目。 JRE版本不一致?
烤鱼想睡觉 2012-07-31
  • 打赏
  • 举报
回复
没有出现红色的叉,现在报错Syntax error , parameterized types are only available if source level is 1.5!!

但是改成了1.5还是报同样的错误!!
YAVA_2009 2012-07-29
  • 打赏
  • 举报
回复
你可以检查一下eclipse的配置:
邮件单击你的工程————》properties——————》选择JavaBuidPath,
看右边是否存在红色的叉,如果有,在libraries中将其移除,应该就可以了
comeoncomputer 2012-07-29
  • 打赏
  • 举报
回复
应该是你的jsp脚本表达式出错了,导致无法编译!ClassNotFoundException: org.apache.jsp.BBS.WebRoot.article_jsp你看异常信息自己去猜。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧