type Exception report
message An exception occurred processing JSP page /home/index.jsp at line 54
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /home/index.jsp at line 54
51:
52:
53:
54: HashMap background = com.controlj.green.definitions.Utilities.getBackground();
55: String background_image = "";
56: if(!background.isEmpty()){
57: background_image = "data:image/png;base64," + background.get("bytes").toString();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
com.controlj.green.servlets.Index.doGet(Index.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause
javax.servlet.ServletException: java.lang.IncompatibleClassChangeError: Found class com.mysql.jdbc.Statement, but interface was expected
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
org.apache.jsp.home.index_jsp._jspService(index_jsp.java:83)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
com.controlj.green.servlets.Index.doGet(Index.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause
java.lang.IncompatibleClassChangeError: Found class com.mysql.jdbc.Statement, but interface was expected
com.controlj.green.definitions.Utilities.getBackground(Utilities.java:172) org.apache.jsp.home.index_jsp._jspService(index_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
com.controlj.green.servlets.Index.doGet(Index.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
Apache Tomcat/7.0.42
我真的不知道什么是错在管线54
这显然是这样调用的: com.controlj.green.definitions.Utilities.getBackground();
是:
import java.util.*;
public static HashMap getBackground() throws SQLException, ClassNotFoundException, IOException {
if(establishConnection()){
Statement st = (Statement) con.createStatement();
rs = st.executeQuery("select bytes from connection_string");
ResultSetMetaData md = (ResultSetMetaData) rs.getMetaData();
int columns = md.getColumnCount();
HashMap list = new HashMap();
if (rs.next()) {
for(int i=1; i<=columns; ++i){
list.put(md.getColumnName(i),rs.getObject(i));
}
}
return list;
}else{
return null;
}
}
什么可能是错误的呢?
谢谢。
+0
看[这里](http://stackoverflow.com/questions/6027104/java-lang-incompatibleclasschangeerror-found-class-com-mysql-jdbc-statement-bu)也许这会有所帮助。 –