java.lang.NullPointerException at org.apache.poi.hwpf.usermodel.Paragraph.newParagraph(Paragraph.java:113) at org.apache.poi.hwpf.usermodel.Range.getParagraph(Range.java:888) at extractParamLpug.<init>(extractParamLpug.java:88) This error was fixed by changing hwpf/usermodel/Paragraph.java: 113c113 < if ( listLevel.getGrpprlPapx() != null ) --- > if ( listLevel != null && listLevel.getGrpprlPapx() != null )
Jim, Could you please provide an example file to check if error is still present? Sergey
The file contains proprietary information. I don't enough about doc format or the java code to recreate the file without the proprietary information. On the other hand, it is clear that a null pointer should not be de-referenced.
Jim, It is possible that null pointer is occurred due to incorrect handling of some other internal structure, or just because document is corrupted. Please, check if NPE is still thrown by trunk code, and if document is passing BFF validation. Sergey
After I made the change described in the Description, everything ran fine. There was no exceptions and I got the results I was looking for. Here is the output of BFF: <BFFValidation path="X" datetime="11/07/12 13:55:08" result="PASSED"> </BFFValidation> I replaced the file name above.
This was fixed in r1305810. POI 3.9 was the first final release to include this fix.