回 帖 发 新 帖 刷新版面

主题:java.lang.NoSuchMethodError~~这个是什么错误啊~帮下忙啊~~

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

javax.servlet.ServletException: com.liuyan.messageBean.getMessage()Ljava/util/Collection;
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
    org.apache.jsp.viewmessage_jsp._jspService(viewmessage_jsp.java:105)
    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)
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
    org.apache.jsp.addMessage_jsp._jspService(addMessage_jsp.java:87)
    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: com.liuyan.messageBean.getMessage()Ljava/util/Collection;
    org.apache.jsp.viewmessage_jsp._jspService(viewmessage_jsp.java:64)
    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)
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
    org.apache.jsp.addMessage_jsp._jspService(addMessage_jsp.java:87)
    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.


jsp 文件是 
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="com.liuyan.*,java.util.*,java.sql.* "%>
<%request.setCharacterEncoding("GBK");%> 
<%@page language="java" %>
<html>
<body>
<jsp:useBean id="messageBean" class="com.liuyan.messageBean" scope="page"/>
   
<%
int message_count=0;
Collection messages=messageBean.getMessage();
Iterator it=messages.iterator();
while(it.hasNext()){
message messagevo=(message)it.next();
%>
<table width="665" align="center" border="1" brcolor="99ccff" cellspacing="0" cellpadding="0" bordercolordark="#000000" bordercolorlight="#CCCC99" height="95">
<tr><td bgcolor="#CCCC99"><font size="2">主题:</font></td>
<td colspan="3"><%=messagevo.getTitle()%></td></tr>
<tr><td bgcolor="#CCCC99"><font size="2">留言人:</font></td>
<td><%=messagevo.getName()%></td></tr>
<tr><td bgcolor="#CCCC99"><font size="2">Email:</font></td>
<td><%=messagevo.getEmail()%></td></tr>
<tr><td bgcolor="#CCCC99"><font size="2">留言内容:</font></td>
<td><%=messagevo.getContent()%></td></tr>
<% 
%>
<tr><td bgcolor="#CCCC99"><font size="2"><%out.print("("+message_count+")");%></font></td></tr>
<% 
}
%>

</body>
</html>

回复列表 (共1个回复)

沙发

检查能否正确编译那个文件bean

我来回复

您尚未登录,请登录后再回复。点此登录或注册