title: How to avoid java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy(Ljava/io/InputStream;Ljava/io/OutputStream;) in Apache POI
body: <p>I have a code for adding watermark to existing .doc file.</p>
  
  <p>The following is the code I have tried so far</p>
  
  <pre><code>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();
      }
  }
  </code></pre>
  
  <p>The following is what I got</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V
  at org.apache.poi.util.PackageHelper.open(PackageHelper.java:50)
  at org.apache.poi.xwpf.usermodel.XWPFDocument.&lt;init&gt;(XWPFDocument.java:71)
  at com.avi.Test.ReadDoc.main(Watermark.java:38)
  </code></pre>