java.lang.ClassCastException: Dispatch object expected

运行项目出现异常:
java.lang.ClassCastException: Dispatch object expected
at com.jacob.com.Dispatch.invokev(Dispatch.java:803)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
at com.lyang.governmentbill.utility.report.Java2Word.getTables(Java2Word.java:665)
at com.lyang.governmentbill.utility.report.Java2Word.getTable(Java2Word.java:710)
at com.lyang.governmentbill.utility.report.Java2Word.setCellValue(Java2Word.java:746)
at mgr.lyang.governmentbill.CCI.jsp.Bean.zdy.jlbzdyreportManagerBean.reportzdy(jlbzdyreportManagerBean.java:208)

at org.apache.jsp.Manager.zdy.showinfo_jsp._jspService(showinfo_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


if(action.equalsIgnoreCase("ReportZDY")){  

int j = 0;
Map reMap = this.govSession.getJlbzdyreportManager().getReportinfo(bbsql);

List result=(ArrayList)reMap.get("result");
String[] columns=(String[])reMap.get("columns");
System.out.println(columns.length+" -----------");
for (int i = 0; i < result.size(); i++) {
Map hm=(HashMap) result.get(i);
if(reMap.get("&pxxh&").toString().equalsIgnoreCase("0"))
{
Java2Word.addFirstTableCol(1);
Java2Word.setCellValue(1,i+3,1,j+""); //第一张表的第i_2行的第1列的值为:hm.get("&i&").toString()....
for(int m=2;m<=columns.length+1;m++){
Java2Word.setCellValue(1,i+3,m,hm.get(columns[m-2]).toString());  
}
}
else
{
for(int m=1;m<=columns.length;m++){
System.out.println(hm.get(columns[m-1]).toString()+" m= "+m);
Java2Word.setCellValue(1,i+3,m,hm.get(columns[m-1]).toString()); //208行,这个错误我怎么也找不出来
}  
}

j++;
if(i!=result.size()-1)
Java2Word.addRow(1);


// Java2Word.save(outPath+"doc\\"+name);
reFilename=name;
}

希望各位朋友帮帮我,在此先谢谢了。如果有朋友解决了我的问题我可以再追加分数。谢谢!!!!

你可能感兴趣的:(java,apache,tomcat,jsp,servlet)