Menu

#291 v.4.7.6 PrimaveraPMFileWriter.write fails with java.lang.IllegalArgumentException

v1.0_(example)
closed-fixed
Jon Iles
None
2
2016-03-07
2016-02-18
Andrew H
No

Hi,

I'm getting the following from MPXJ 4.7.6, it was originally working and now there is a problem with the following line:
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");

Here is the exception which pointed me to it
java.lang.IllegalArgumentException
at oracle.xml.jaxp.JXTransformer.setOutputProperty(JXTransformer.java:796)
at net.sf.mpxj.primavera.PrimaveraPMFileWriter.write(PrimaveraPMFileWriter.java:112)
at net.sf.mpxj.writer.AbstractProjectWriter.write(AbstractProjectWriter.java:55)
at pmsched.writer.PrimaveraWriter.writeScheduleToPMXML(PrimaveraWriter.java:49)
at pmsched.ExportPrimaveraPMXMLAction.execute(ExportPrimaveraPMXMLAction.java:105)

I tried the namespace URI though this it returns a 404 now, as Apache has retired the XML project. Is this a brand new error? I can't just upgrade to the last release as there were many API changes causing my methods to break. I see the same line in version 5.2.1 as well.

It may not be required anyways, I'm trying to find a way to build the version 4.7.6 without it, looks like I'm missing some pieces to the puzzle.

Thanks,
Andrew H

Discussion

  • Jon Iles

    Jon Iles - 2016-03-07

    I've added some code to the latest version which just swallows any exceptions raised when trying to configure the transformer. You won't get the nice indentation, but you should get usable XML. Let me know if this doesn't work for you.

    Jon

     
  • Jon Iles

    Jon Iles - 2016-03-07
    • status: open --> closed-fixed
    • assigned_to: Jon Iles
     

Log in to post a comment.

MongoDB Logo MongoDB