[JavaAction] Error reading Excel using Poi

0
mendix version 10.6.7   I wanted to read Excel data using JavaAction and Poi. So, I put the poi and other dependency library files in the userlib folder, wrote the source code, and executed it, but I encountered the following error So, I began to suspect whether the issue was due to the version. I tried running the same source code and libraries using regular Java instead of Mendix, and I confirmed that it actually worked properly. What could be the problem?   ------------- Here's the Mendix source code.   And this is the source code that has been verified to run in Intellij.
asked
3 answers
1

Hello Kim,

 

There is some documentation here about adding the dependencies and troubleshooting them:

 

https://docs.mendix.com/refguide/managed-dependencies/

 

Maybe also check other java actions from other modules and look how they are designed

 

Hope it helps,

 

Good luck!

answered
1

I followed the method you mentioned, but the same error still occurs. Is there something I might have done wrong?

 

image.png

image.png

 

image.png

answered
1

That looks like you may have several copies of the apache commons io library in your userlib. 

 

To fix this look for any commons-io.X.X.jar modules in your userlib and remove all but the file with the highest version number.

 

Alternatively, instead of using your own Java code, have a look at the Excel Importer module in the Marketplace. It uses POI so you will have working Java code from that.

 

Good luck!

answered