1

这是我得到的例外:

org.apache.poi.hwpf.model.ListLevel.( ListLevel.java:120) 在 org.apache.poi.hwpf.model.ListFormatOverrideLevel.(ListFormatOverrideLevel.java:48) 在 org.apache.poi.hwpf.model.ListTables.(ListTables.java:88) 在 org.apache .poi.hwpf.HWPFDocument.(HWPFDocument.java:267) 在 org.apache.poi.hwpf.HWPFDocument.(HWPFDocument.java:157) 在 com.mahesh.MyFrame.readMSDocuments(MyFrame.java:301) 在 com。 mahesh.MyFrame.readALLDocuments(MyFrame.java:276) at com.mahesh.MyFrame.access$1(MyFrame.java:269) at com.mahesh.MyFrame$2.actionPerformed(MyFrame.java:231) at javax.swing.AbstractButton javax 的 .fireActionPerformed(Unknown Source)。swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source ) 在 java.awt.Component.processMouseEvent(Unknown Source) 在 javax.swing.JComponent.processMouseEvent(Unknown Source) 在 java.awt.Component.processEvent(Unknown Source) 在 java.awt.Container.processEvent(Unknown Source) 在java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java. awt.LightweightDispatcher。processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent( Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) ) 在 java.awt.EventDispatchThread.pumpEvents(Unknown Source) 在 java.awt.EventDispatchThread.pumpEvents(Unknown Source) 在 java.awt.EventDispatchThread.run(Unknown Source)dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters( Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ) 在 java.awt.EventDispatchThread.run(Unknown Source)dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters( Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ) 在 java.awt.EventDispatchThread.run(Unknown Source)EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread。 java.awt.EventDispatchThread.run(未知源)上的 pumpEvents(未知源)EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread。 java.awt.EventDispatchThread.run(未知源)上的 pumpEvents(未知源)

这是我的代码

private void readMSDocuments(String fileToRead) {

    boolean containsEditorAndMt = false;
    String fileEditorAndMt = null;
    dataArray = null;
    try {

        fis = new FileInputStream(new File(fileToRead).getAbsolutePath());
        fs = new POIFSFileSystem(fis);
        document = new HWPFDocument(fs);
        wordExtractor = new WordExtractor(document);
        dataList = new ArrayList();
        dataArray = wordExtractor.getParagraphText();//getParagraphText() reads paragraphs so problem is each paragraph is read a single line .u can see in console
        System.out.println(dataArray.length);
        if (dataArray.length >= 0) {


            for (int k = 0; k < dataArray.length; ++k) {

                if (dataArray[k].trim().length() > 0) {

                    dataList.add(dataArray[k].trim());
                    //System.out.println(fileToRead+" "+dataArray[k].trim()+"\n");
                }
            }
        }

    }
}

谁能帮我找出引发异常的原因?

4

1 回答 1

1

您正在使用 Apache POI API:
这是此域中的错误。

您可以阅读此错误并通过进行分析。

于 2012-05-31T10:26:15.943 回答