简体   繁体   中英

Exception in thread “main” java.lang.NoSuchFieldError: filesystem

i have written a program for reading the contents of my microsoft word document file. 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 ..

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.

If yes, keep single copy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM