Excel Importer Java action fails

0
Hi Everyone,   We are migrating our application to Mendix version 10.6.1, during the process Excel importer was upgraded to version 10.3.0, During Testing Excel Import fails while executing StartImportByTemplate Java action with below error Message.   Error in execution of monitored action '{"name":"ExcelImporter.IVK_ImportTemplateDocument","type":"Microflow"}' (execution id: c30d9848-6cdc-47ba-b733-dcadf1d7c0ec, execution type: CLIENT_ASYNC_MONITORED)   java.lang.NoSuchMethodError: org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.builder()Lorg/apache/commons/io/output/UnsynchronizedByteArrayOutputStream$Builder;   Please help in rectifying issue.
asked
3 answers
2

You are either missing a jar file (org.apache.commons.io) or you have a duplicate version in the lib folder of your mendix application's directory.

If you have  a duplicate version of this jar file remove the oldest version and clean the deployment directory from studio pro and restart your app. This is probably the cause.

answered
1

I remove org.apache.commons.io-2.3.0.jar 

and commons-io.commons-io-2.11.0.jar

and it worked for me.

answered
0

This was a gnarly one for me. It took me a whole day to figure out, part of which I spent researching the commons.io github repository to determine which version of commons-io introduced the Builder() method.

This is what I did to resolve this error: I deleted several duplicate jar files as most answers suggested but it didn't fix the problem. Thankfully, the userlib folder now has what I call "comment" files that indicate what modules are dependent on a particular jar file. So I looked for all the jar files that are dependencies of XLSReport and ExcelImporter and deleted older versions of the jar files. The files I deleted were:

  • org.apache.commons.io_2.8.0.jar
  • commons-io.commons-io-2.11.0.jar
  • org.apache.commons.commons-io_2.15.1.jar
  • replication.jar
  • commons-lang3-3.11.jar
  • opencsv-5.4.jar

Once I deleted these jar files, the error went away. I hope this helps someone else avoid a whole day of jar file hell.

answered