Maven Dependency
<dependency>
<groupId>de.phip1611</groupId>
<artifactId>docx4j-search-and-replace-util</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j</artifactId>
<version>6.1.2</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
My Code is look like this as mentioned below.
WordprocessingMLPackage sourceDocxDoc = WordprocessingMLPackage.load(fileInputStream) ;
ByteArrayOutputStream out = new ByteArrayOutputStream();
HashMap<String, String> replace = new HashMap<String, String>();
replace.put("$Tag1","My Db Data");
.
.
.
.
.
.
Docx4JSRUtil.searchAndReplace(sourceDocxDoc, replace);
sourceDocxDoc.save(out);
program runs successfully on local environment but sometimes getting exception on production environment as per attached image on line sourceDocxDoc.save(out);
I can't debug it on local environment, so anyone else experienced this issue while using Docx4j lib to replace MS Word file contains identifier with data.
Java Experts kindly respond.............