poi versions and classpath revisited: poi-ooxml-3.6-20091214.jar
I asked a question about this last October because we were using poi 3.6 for a certain Java action, and Mendix was using 3.1 for its own Excel interface functionality (which we do not require for this project). We resolved that happily by manipulating the CLASSPATH, as suggested in this forum. In version 3.0 of the Mendix platform the poi version used by Mendix now appears to have been updated to 3.6 (poi-3.6-20091214.jar), so I had thought I should not need to import another poi libarary alongside the one that Mendix provides. However, our code needs to use classes WorkbookFactory and InvalidFormatException, which are apparently not included in poi-3.6-20091214.jar but in poi-ooxml-3.6-20091214.jar. This latter file is not included in the Mendix library set so I need to link to it myself, as before. When I try to add poi-ooxml-3.6-20091214.jar to the project in Eclipse it throws a security exception at runtime because this file comes from a different distribution from the poi-3.6-20091214.jar included with Mendix. OK, so I try to replace the Mendix poi library file with the poi-3.6-20091214 file from the same distribution as the ooxml library file, which is identical apart from the security certificate. Then Eclipse just reports that all the poi files are missing when Mendix has finished compiling the Java, and at runtime I get a class not found error on any of the poi classes. It doesn't seem to matter where I put the files; when it compiles, it seems to copy them to deployment\model\lib\userlib and then Eclipse complains that they are missing. But the files are actually visible in both locations at this point. Anyone know how in Mendix 3.0 I can link to both poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar as well?
I've noticed in 2.5 that Eclipse looks at deployment\model\lib\userlib, so after a deploy it will be visible, but copying direct might be faster. Don't forget to copy to userlib as well. Otherwise you might loose the file after a deploy.
We seem to have fixed this by copying our poi distribution to the Mendix business modeller distribution itself. We put all three files in x\runtime, where x is the path to the installation directory (in our case C:\ProgramFiles\Mendix\3.0.0-beta), replacing the copy of poi-3.6-20091214.jar that was already there.