[英]Exception in thread “main” java.lang.NoSuchFieldError: filesystem
i have written a program for reading the contents of my microsoft word document file. 我已经编写了一个程序来读取我的Microsoft Word文档文件的内容。 actualy my requirement is to get the document map of the word.doc, i throught of getting started with reading the doc file my code is ..
实际上,我的要求是获取word.doc的文档结构图,我从阅读doc文件开始。
public static void readParagraphs(HWPFDocument doc) throws Exception
{
WordExtractor we = new WordExtractor(doc);
/**Get the total number of paragraphs**/
String[] paragraphs = we.getParagraphText();
System.out.println("Total Paragraphs: "+paragraphs.length);
for (int i = 0; i < paragraphs.length; i++)
{
System.out.println("Length of paragraph "+(i +1)+": "+ paragraphs[i].length());
System.out.println(paragraphs[i].toString());
}
}
but am getting Exception in thread "main" java.lang.NoSuchFieldError: filesystem
at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:218)
at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:158)
at com.honeywell.corept.srd.ReadDocFileFromJava.readMyDocument(ReadDocFileFromJava.java:25)
at com.honeywell.corept.srd.ReadDocFileFromJava.main(ReadDocFileFromJava.java:18)
this exception am not able to solve this. 此异常无法解决此问题。 please help.
请帮忙。
Please check if you have two copies of POI JAR on your classpath. 请检查您的类路径上是否有POI JAR的两个副本。
If yes, keep single copy. 如果是,请保留一份副本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.