It might be a bug in Word 2008, it was the first version of MS Office for Mac that supported the .docx format. Can the problem be reproduced with the latest Word 2011 for Mac ? What happens if you open a document that POI cannot read in Word 2010 for Windows and re-save it ? Can POI read it ?
Which version of POI are you using? Try with with the latest POI 3.8-beta5. A number of bugs related to reading OPC packages has been recently fixed. If the problem is still there, please create a new Bugzilla issue and attach the problematic file. Cheers, Yegor On Wed, Jan 18, 2012 at 3:50 AM, Gregg Morris <[email protected]> wrote: > Hello-- > > We have a process that takes a Word document (docx) and merges content into > it, at locations in the document indicated by the document's creator. At > the moment there is a small set of authors using only Word 2008 (for Mac), > but this is likely to soon become a larger group of authors using Word for > Windows (2007+) as well. > > We've discovered that Word can produce documents that cause > NullPointerExceptions when loaded into POI. Two cases appear to be bugs > (not handling objects that could be null), but one case clearly is not: > "OPC Compliance error [M4.1]: there is more than one core properties > relationship in the package !". Word can happily read and write files that > cause this error in POI. > > My concerns are these: > 1) How do I tell my authors to avoid this? In other words, what are they > doing in Word to create multiple core properties? > 2) Knowing that Word can cheerfully read and write documents that POI > considers invalid, but needing to support my users, should I modify the POI > code to relax this particular error checking? In this case I could just use > the first core properties document part that is encountered and ignore any > others. I guess this is a letter-of-the-law versus intent-of-the-law > situation. It's not a perfect world out there; how best to handle it? > > Thanks for any suggestions! > Gregg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
