java调用word卡死_来来来,遇见问题了,我在使用jacob处理一堆word文档

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

Stack: [0x1d290000,0x1d2e0000], sp=0x1d2df0a0, free space=316k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

C [jacob.dll+0xc5de] Java_com_jacob_com_DispatchProxy_release+0x27ae

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)

J com.jacob.com.Variant.init()V

j com.jacob.com.Variant.(Ljava/lang/String;)V+10

j com.jacob.com.Dispatch.obj2variant(Ljava/lang/Object;)Lcom/jacob/com/Variant;+61

j com.jacob.com.Dispatch.obj2variant([Ljava/lang/Object;)[Lcom/jacob/com/Variant;+19

j com.jacob.com.Dispatch.invoke(Ljava/lang/Object;Ljava/lang/String;I[Ljava/lang/Object;[I)Lcom/jacob/com/Variant;+4

j com.jacob.com.Dispatch.put(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V+14

j com.heavenlake.wordapi.Document.find(Lcom/jacob/com/Dispatch;Ljava/lang/String;)Z+27

j com.heavenlake.wordapi.Document.replaceAll(Lcom/jacob/com/Dispatch;Ljava/lang/String;Ljava/lang/String;)V+25

j com.heavenlake.wordapi.Document.replaceAll(Ljava/lang/String;Ljava/lang/String;)V+7

j cn.grassinfo.rmon.stat.Util.DownTableUtil.creatFile(Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/util/List;ILjava/lang/String;Ljavax/servlet/ServletContext;)V+291

j cn.grassinfo.rmon.system.timer.MakeReportFile.agingCity(Lcn/grassinfo/rmon/stat/domain/DownModel;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V+853

j cn.grassinfo.rmon.system.timer.MakeReportFile.run()V+261

j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+46

j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5

j java.lang.Thread.run()V+11

v ~StubRoutines::call_stub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
很抱歉,我并不是一个可以浏览文档的程序,也没有能力打开网页查找相关信息。但是,我可以告诉你如何使用Java将多个Word文档合并为一个Word文档。 可以使用Apache POI库来操作Word文档。以下是将多个Word文档合并为一个Word文档的示例代码: ``` import java.io.*; import org.apache.poi.xwpf.usermodel.*; public class MergeWordDocuments { public static void main(String[] args) throws Exception { String[] files = {"doc1.docx", "doc2.docx", "doc3.docx"}; XWPFDocument finalDoc = new XWPFDocument(); for (String file : files) { XWPFDocument doc = new XWPFDocument(new FileInputStream(file)); for (XWPFParagraph para : doc.getParagraphs()) { XWPFParagraph newPara = finalDoc.createParagraph(); newPara.createRun().setText(para.getText()); } for (XWPFTable tbl : doc.getTables()) { XWPFTable newTbl = finalDoc.createTable(); newTbl.getCTTbl().setTblPr(tbl.getCTTbl().getTblPr()); for (int i = 0; i < tbl.getRows().size(); i++) { XWPFTableRow row = newTbl.getRow(i); if (row == null) row = newTbl.createRow(); for (int j = 0; j < tbl.getRow(i).getTableCells().size(); j++) { XWPFTableCell cell = row.getCell(j); if (cell == null) cell = row.createCell(); cell.getCTTc().setTcPr(tbl.getRow(i).getCell(j).getCTTc().getTcPr()); for (XWPFParagraph para : tbl.getRow(i).getCell(j).getParagraphs()) { XWPFParagraph newPara = cell.addParagraph(); newPara.createRun().setText(para.getText()); } } } } } FileOutputStream out = new FileOutputStream("finalDoc.docx"); finalDoc.write(out); out.close(); finalDoc.close(); } } ``` 上述代码将会把 `doc1.docx`,`doc2.docx` 和 `doc3.docx` 合并为 `finalDoc.docx` 文件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值