poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46472] New: NPE in HPSFPropertiesExtractor.getDocumentSummaryInformationText gives NPE
Date Mon, 05 Jan 2009 00:55:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46472

           Summary: NPE in
                    HPSFPropertiesExtractor.getDocumentSummaryInformationTex
                    t gives NPE
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HPFS
        AssignedTo: dev@poi.apache.org
        ReportedBy: adb@teamware.com


java.lang.NullPointerException
        at
org.apache.poi.hpsf.extractor.HPSFPropertiesExtractor.getDocumentSummaryInformationText(HPSFPropertiesExtractor.java:59)
        at
org.apache.poi.hpsf.extractor.HPSFPropertiesExtractor.getText(HPSFPropertiesExtractor.java:128)

It's caused by the following when trying to extract meta data properties from a
Word document 

 POITextExtractor extractor = ExtractorFactory.createExtractor(new
ByteArrayInputStream(raw));
 POITextExtractor mdExtractor = extractor.getMetadataTextExtractor();
 if (mdExtractor != null)
 {
     String md = mdExtractor.getText();
     System.out.println("MD=:" + md);
 }

and is caused because my Word document would not appear to have custom
properties, therefore the getCustomProperties() method returns null in the
following...

public String getDocumentSummaryInformationText() {
...
   // Now custom ones
   CustomProperties cps = dsi.getCustomProperties();
   Iterator keys = cps.keySet().iterator();
...


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message