0

I run into this error on one box but not another, when using code to "pretty print" XML:

ERROR! java.lang.NoSuchMethodError: com.sun.org.apache.xml.internal.serialize.OutputFormat.<init>(Lorg/w3c/dom/Document;)V

What could be the problem?

rogerdpack
  • 62,887
  • 36
  • 269
  • 388

1 Answers1

4

Turns out the box with the failure was running "JDK 11" so fix for me was to temporarily use "JDK 8" instead for now. Appears replacement alternatives are discussed here

I have got this warning: com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release

See also Serialize DOM to FileOutputStream using Xerces and https://stackoverflow.com/a/9331063/32453 but I don't see an exact replacement.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388