我在用JavaMail做收邮件的程序时,有时会出现这样一个异常,我不知道这是什么意思,为什么会产生。请大家帮心解释一下
type Exception report
message Internal Server Errordescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception java.lang.ClassCastException
at org.apache.jsp.receive$jsp._jspService(receive$jsp.java:104)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
.
.
.
.
exception java.lang.ClassCastException
~~~造型错误,也就是:例如我有一个方法(getA())返回一个对象A,而你却把他造型为B对象,于是就产生这样的错误了。
...
public A getA()
{
...
return lA;//
}
....
A lAA = null;
lAA = (B)getA();