我的配置是 myeclipse 5.5 jdk1.6 Tomcat 5.0  有人说tomcat不支持jdk1.6 不知道是不是。。
源码:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"
contentType="text/html; charset=gb2312" %>

<jsp:directive.page import="my.blog.BLL.RunSql" />
<jsp:directive.page import="my.blog.info.Info" /><%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Mpl博客程序 - Mpl小组</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href="css/style.css" rel="stylesheet" type="text/css"> </head>
<body>

<font color="#333" id="title_div_style">CStrings博客系统</font>
<%
String sql = "select title,[type],createDate,author,click,comment from nr_table";
//list集合保存信息
List list = new ArrayList();
RunSql rs = new RunSql(); list = rs.RunSelect(sql); //开始输出数据
for (int i = 0; i < list.size(); i++) 
{
Info blogInfo = (Info) list.get(i);
%>
<table width="100%" border="0" cellspacing="2" id="wz_div_style">
<tr>
<td colspan="4" id="bt_div_style">
<%=blogInfo.title%>
</td>
</tr>
<tr>
<td id="lie_div_style">
类别:
<%=blogInfo.type%>
</td>
<td>
发布时间:
<%=blogInfo.createDate%>
</td>
<td>
评论:
<%=blogInfo.comment%>
</td>
<td>
浏览:
<%=blogInfo.click%>
</td>
</tr>
</table>
<%
}
%>
</body>
</html>
下面的错误。。 500错误
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: my.blog.BLL.RunSql.RunSelect(Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.index_jsp._jspService(index_jsp.java:134)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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)
root cause java.lang.NoSuchMethodError: my.blog.BLL.RunSql.RunSelect(Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;
org.apache.jsp.index_jsp._jspService(index_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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.
--------------------------------------------------------------------------------Apache Tomcat/5.0.28

解决方案 »

  1.   

    还有。。数据库是用的 msSql2005
      

  2.   

    RunSelect  这个方法 在java文件中如何写的?
      

  3.   

    重新编译一下整个项目。检查RunSql这个类中是不是有RunSelect()方法,错误日志的字面意思是RunSql类中没有RunSelect()方法。
      

  4.   

    我用test类测试了。。在控制台是可以显示的 郁闷啊··
      

  5.   

    你关闭一下  数据库连接试下...
    在finally中关闭ResultSet、Statement、Connection对象所产生的对象
      

  6.   

    <jsp:directive.page import="my.blog.BLL.RunSql" />
    <jsp:directive.page import="my.blog.info.Info" />
    这样子正确引入了吗,为什么不用<%@ page inport="" %>
      

  7.   

    <%@page import="my.blog.BLL.RunSql" %>
      

  8.   

    Ljava/lang/String ...你把string数组当成string了...
    >_<
      

  9.   

    RunSelect()  这个方法咋写的啊,贴出来啊,估计里面有问题哈
      

  10.   

    java.lang.NoSuchMethodError: my.blog.BLL.RunSql.RunSelect(Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;
    org.apache.jsp.index_jsp._jspService(index_jsp.java:84) 这个方法调用的对不? 看下参数,返回 如果调用没错,函数本身有问题没?
      

  11.   

    public List RunSelect(String sql){

    PreparedStatement pst = null;
    ResultSet rs = null;
    List list = new ArrayList();
    try{
    pst = this.getConn().prepareStatement(sql);//这个是父类的连接数据库方法 //执行sql语句
    rs = pst.executeQuery();

    while(rs.next()){
    Info info = new Info();//实体类
    info.title = rs.getString("title");
    info.type = rs.getString("type");
    info.createDate = rs.getDate("createDate").toString();
    info.author = rs.getString("author");
    info.click = rs.getInt("click");
    info.comment = rs.getInt("comment");

    list.add(info);//添加到集合中
    }
    }catch(SQLException e){

    e.printStackTrace();
    }
    return list;
    }
    这个是RunSelect 的代码···
    大家帮看看···
      

  12.   

    org.apache.jsp.index_jsp._jspService(index_jsp.java:84) 
    index_jsp.java:84
    这个是的页面吧
    把84行贴出来
      

  13.   

    Info这个类中,有没有字段错误!
      

  14.   

    回复Fish3812 .. 整个页面都没有84行.......回复zhanshengkui .. 没有字段错误..通常错误的话.. IDE会自动提示.. 郁闷啊``````````