Katalon Studio / Runtime Engine version : 7.7.2
Scenario/Background :
Currently I am using poi-4.1.0 for output some test evidence to Excel file.
In order to use poi-4.1.0, instead of importing via Gradle or external library in project’s setting, I cloned the jar file to \Katalon_Studio_7.7.2\configuration\resources\lib and remove the following dependencies that are related to poi-3.17 as I am intended to use the newer version :
- poi-3.17.jar
- poi-ooxml-3.17.jar
- poi-ooxml-schemas-3.17.jar
- xmlbeans-2.6.0.jar. ( For poi-4.1.0, it needs xmlbeans-3.1.0.jar instead. )
I have to delete the above jars, otherwise when I use any class from poi such like XSSFWorkbook, it will keep referring the class from poi-3.17.
Issue :
I can use poi-4.1.0 without any issue in Katalon Studio after importing the dependencies like above.
However, when I tried to run my test suite with Katalon Runtime Engine, it ran into the following error :
java.lang.NNoSuchMethodError : org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit
I did some investigation and realize that it is because such method is not existed in org.apache.xmlbeans-2.6.0 which comes along with Katalon Studio and Katalon Runtime Engine ( in the \Katalon_Studio_7.7.2\plugins folder. )
Seems that in Katalon Runtime Engine’s case, the org.apache.xmlbeans-2.6.0 will be loaded before the xmlbeans-3.1.0 that I imported manually. ( Katalon Studio has different class paths loading precedence than Runtime Engine. )
I once tried replacing the xmlbeans in Katalon Runtime Engine with the newer version, but that breaks the engine itself.
Tagging @devalex88 @ThanhTo
Is there any way that we can manage the dependency precedence if we want to use some depedencies that are also used by Katalon Runtime Engine ? or perhaps a workaround ?