How to avoid java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy(Ljava/io/InputStream;Ljava/io/OutputStream;) in Apache POI
问题 I have a code for adding watermark to existing .doc file. The following is the code I have tried so far public static void main(String[] args) { try { XWPFDocument xDoc = new XWPFDocument(new FileInputStream("test.doc")); XWPFHeaderFooterPolicy xFooter = new XWPFHeaderFooterPolicy(xDoc); xFooter.createWatermark("My Watermark"); } catch(Exception e) { e.printStackTrace(); } } The following is what I got Exception in thread "main" java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy