Katalon using embedded version of a jar instead of the one added via library management

I’m using Katalon studio 8.6.8, recently i’ve added an external jar to use it as part of my test cases but seems like Katalon it’s using the embedded version of the same which has a different version, due that, the available methods aren’t even getting auto completed nor showing if i try to go into declaration.
But when i replace the embedded version from Katalon folder/plugins with mine, it now shows all the available methods, but obviously this isn’t the best, not even a good approach at all.

Do you guys perhaps know how can i force Katalon to use MY version of the same jar to be available to use in code ?
The jar in question it’s called com.networknt.json-schema-validator_1.0.66 contained in the Katalon/plugin folder.

Regards.

Let me show you an example.

I downloaded the json-schema-validator-1.5.3.jar from the Maven Central Repository, located in the Drivers folder of my “test” project on my machine.

I stopped Katalon Studio and restarted it.

Immediately under the project directory, you will find a file named .classpath. The .classpath file contains lines as follows:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	...
	<classpathentry kind="lib" path="/Applications/Katalon Studio.app/Contents/Eclipse/plugins/com.networknt.json-schema-validator_1.0.66.jar"/>
    ...
	<classpathentry kind="lib" path="/Users/kazurayam/katalon-workspace/test/Drivers/json-schema-validator-1.5.3.jar"/>
	...
</classpath>

There are 2 classpath entries that point the json-schema-validator jar.

The first entry is the one bundled in the Katalon Studio’s distributable, of which version is 1.0.66

The second entry is the one I added in the Drivers folder, of which version is 1.5.3.

When you run your test case script, Katalon Studio provides this .classpath definition to Java Runtime Engine. JRE will look for a class in the list of jars as defined in the .classpath. When 2 or more jar entries contain a single class duplicating, then the class will be picked out of the 1st jar listed in the classpath, regardless which version it is.

As you see the .classpath example, the jars bundled in the Katalon Studio comes earlier than the jars you added. So it will have higher precedence than the one you added in the Drivers folder.

I suppose that you, @armando.lopez, want to use the v1.5.3 rather than the v1.0.66.

It is possible.

How to?

See Exclude built-in libraries

Effectively you can erase the line of

	<classpathentry kind="lib" path="/Applications/Katalon Studio.app/Contents/Eclipse/plugins/com.networknt.json-schema-validator_1.0.66.jar"/>

out of the .classpath file.

2 Likes

I am not sure if you can erase the line of classpathentry for the jar contained in the plugin folder by the procecudre described at the Library management in Katalon Studio | Katalon Docs. I haven’t examined it. Please try yourself and report the result here.

This worked like a charm, i just added the embedded version from Katalon studio 1.0.66 to the excluded built-in list and that solved my issue Now Katalon seems to take MY version 1.5.3 over the one included on Katalon. Thanks @kazurayam !!!

1 Like