title: ColdFusion & Java (docx4j library)
body: <p>I need to do docx manipulation (find/replace on placeholders and checking/unchecking checkboxes). Since ColdFusion 10 integrates well with Java, I decided to try and use the Java library docx4j, which basically mimics the OpenXML SDK (.net platform).</p>
  
  <p>I have the docx4j JAR inside a custom folder, which I have setup in my Application.cfc via JavaSettings (new in CF10, and I tried it with other JARS and it works):</p>
  
  <pre><code>&lt;cfcomponent output="false"&gt;
  
      &lt;cfset this.javaSettings =
          {LoadPaths = ["/myJava/lib"], loadColdFusionClassPath = true, reloadOnChange= true, 
          watchInterval = 100, watchExtensions = "jar,class,xml"} /&gt;
  
  &lt;/cfcomponent&gt;
  </code></pre>
  
  <p>Now, I'm trying to use this sample:<a href="https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/samples/VariableReplace.java" rel="nofollow">https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/samples/VariableReplace.java</a></p>
  
  <p>But trying to call the WordprocessingMLPackage fails with the function <em>CreateObject()</em> saying that particular class doesn't exist:</p>
  
  <pre><code>&lt;cfset docObj = createObject("java","org.docx4j.openpackaging.packages.WordprocessingMLPackage") /&gt;
  </code></pre>
  
  <p>Any ideas? I'm not really a Java guy, but there are not many options out there for docx manipulation.</p>