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!
I followed the method you mentioned, but the same error still occurs. Is there something I might have done wrong?
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!