# Katalon Engine not correctly load Custom Keyword plugin

**URL:** <https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028>\
**Category:** Integrations\
**Tags:** runtime-engine, jenkins, plugins, custom-keyword, katalon-studio\
**Created:** [May 12, 2022, 6:26pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028 "2022-05-12T18:26:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 12, 2022, 6:26pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/1 "2022-05-12T18:26:42Z")

</div>

Hello,

I use private plugin inside Katalon Studio via JAR file inside Plugins folder. Everything works perfectly on my local machine. But when I use run via katalon engine (katalonc) inside Jenkins, plugin is not loaded.

Jenkins says:  
INFO: Katalon Version: 8.3.0  
…  
Delete folder: bin  
Delete folder: Libs  
Cleaning up workspace  
Opening project file: C:\jenkins…\katalon.prj  
Warning! Please run Katalon execution command outside of the project folder.  
Generating global variables…  
Project ‘katalon’ opened  
Start reloading plugins…  
Katalon version: 8.3.0  
…  
Plugin name: UploadFile Keywords. Is online: true. Plugin location: C:\katalon\_engine\configuration\plugin\install\211412\1.0.0\katalon-studio-uploadfile-plugin.jar.

**---- custom private plugin loading**  
Plugin name: katalon-keywords-0.0.2.jar. Is online: false. Plugin location: C:\jenkins…\Plugins\katalon-keywords-0.0.2.jar.

Plugin “UploadFile Keywords” has been installed.¨  
Plugin “katalon-keywords-0.0.2.jar” has been installed.  
Start check license task  
…  
INFO: KATALON\_JAVA\_HOME: null  
…

**And there is the problem**. I don’t know why, but the custom keywords from plugin are not available. Plugin katalon-keywords-0.0.2.jar is inside Plugins folder. On my local machine Katalone run Build while opening project and create CustomKeywords.groovy inside Libs folder. But on remote machine doesn’t. And show error:

```
Caught: java.lang.ClassFormatError: Illegal method name "cz.helpers.CAS.login" in class CustomKeywords
java.lang.ClassFormatError: Illegal method name "cz.helpers.CAS.login" in class CustomKeywords
	at com.kms.katalon.core.main.TestCaseMain.modifyCustomKeywordsClassAtRunTime(TestCaseMain.java:118)
	at com.kms.katalon.core.main.TestCaseMain.beforeStart(TestCaseMain.java:62)
	at com.kms.katalon.core.main.TestCaseMain$beforeStart.call(Unknown Source)
	at TempTestSuite1652367154923.run(TempTestSuite1652367154923.groovy:34)
Launcher status after execution process completed: Running

```

Do you have any idea what is wrong?  
Thanks for you advice,  
Roman.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 12, 2022, 11:24pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/2 "2022-05-12T23:24:05Z")

</div>

> [@roman.jaros](#):
>
> But on remote machine doesn’t.

What do you mean by saying “doesn’t”?

1. there is no `CustomKeywords.groovy` file in the `Libs` directory of the remote project
2. there is a `CustomKeywords.groovy` file, but it does not contain the statement:

```auto
def static "cz.helpers.CAS.login"(
    ...
}

```

1. there is a `CustomKeywords.groovy` file which contains the statement as above. But an error occures.

* * *

> java.lang.ClassFormatError: Illegal method name “cz.helpers.CAS.login” in class CustomKeywords

This message seems to be suggesing the case 2.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 12, 2022, 11:26pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/3 "2022-05-12T23:26:01Z")

</div>

In the log you got

```auto
Plugin “katalon-keywords-0.0.2.jar” has been installed.

```

This message implies that the jar was found in the Katalon Plugin Store, and the `katalonc` succeeded downloading the jar from the Store and installing the jar into the project, but you got an error.

This suggests that the jar has something wrong.

Can you make sure the jar on the remote machine contains the `cz.helpers.CAS` class? You can get the list of contained flies by the command line command.

[jar --list --file jarName](https://www.herongyang.com/Java-Tools/jar-list-Files-in-JAR-File.html).

If the jar does NOT contain the `cz.helpers.CAS` class, it implies that you failed to update the jar version in the repository of Katalon Plugin Store to the latest.

Or, the `cz.helpers.CAS` class in the jar on the remote machine may lack the method `login()`.

Please check.

---

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 13, 2022, 9:14am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/4 "2022-05-13T09:14:33Z")

</div>

Hi [kazurayam](https://forum.katalon.com/u/kazurayam),

thanks for your replies.

About first reply. I know the error looks like second case. But it is case number 1. File is not created on remote machine. I try to add file `CustomKeywords.groovy` to git. Pull him on remote machine. But `katalonc` clear the `Libs` folder when start. And then make some `.groovy` files inside `Libs` folder. But without `CustomKeywords.groovy` file. **So, I thinks this is the problem**. Under `bin/lib` is `CustomKeywords.class` but without the keywords from JAR file.

About second reply. The `katalon-keywords-0.0.2.jar` file is private plugin. Not from Katalon Store (as others plugin). I use our private Nexus. And when i copy the JAR file from local to remote machine, nothing change. So I think, the JAR file is OK, because work on local machine as well.

When i install Katalon Studio on remote machine and open the same project (same folder), everything work as expected. As on local machine. And Katalon Studio make valid `Libs/CustomKeyword.groovy` file with keywords from plugin.

This command run katalonc:  
`C:\jenkins\...\workspace\_gradle_keywords>C:\katalon_engine\katalonc -licenseRelease=true -runMode=console -browserType=Chrome -propertiesFile="C:\jenkins\...\workspace\_gradle_keywords\Jenkins\console.properties" -projectPath="C:\jenkins\..\workspace\_gradle_keywords\katalon-gpk.prj" -apiKey=" ****" --config -proxy.auth.option=MANUAL_CONFIG -proxy.auth.server.type=HTTP -proxy.auth.server.address=**** -proxy.auth.server.port= ****-proxy.system.option=MANUAL_CONFIG -proxy.system.server.type=HTTP -proxy.system.server.address=**** -proxy.system.server.port= **** -proxy.system.applyToDesiredCapabilities=true -webui.autoUpdateDrivers=true`

Output from remote `katalon-keywords-0.0.2.jar` is:

```auto
tech/gradle_keywords $ jar --list --file katalon-keywords-0.0.2.jar                                                                                      
META-INF/
META-INF/MANIFEST.MF
...
cz/helpers/CAS.class ---> there is the CAS class
...
internal/GlobalVariable.class
TempTestCase1652088225176.class
CustomKeywords.class ---> there is the CAS.login keyword map
katalon-plugin.json ---> there is the CAS.groovy path "cz.helpers.CAS"

```

So if the JAR file will be wrong, same problem will be on my local machine or on remote machine under Katalon Studio run. I read documentation but didn’t find any command for force build katalon keywords from katalon engine/katalonc (as do Katalon Studio when I open project).

Thanks.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 13, 2022, 11:15am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/5 "2022-05-13T11:15:29Z")

</div>

> [@roman.jaros](#):
>
> I know the error looks like second case. But it is case number 1. File (CustomKeywords.groovy) is not created on remote machine.

Interesting. It seems to be a problem of Katalon Runtime Engine.

@duyluong

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 13, 2022, 11:19am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/6 "2022-05-13T11:19:38Z")

</div>

By the way, do you really need CustomKeyword.groovy? I guess, you would not need it at all.

You have a class `cz.helpers.CAS` with a method `login()` in your jar, and you are sure your project has that jar in the classth. The the following code in a Test Case would work.

```auto
import cz.helpers.CAS

CAS.login()

```

You don’t need to write:

```auto
CustomKeywords.'cz.helpers.CAS.login'()

```

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 13, 2022, 11:24am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/7 "2022-05-13T11:24:51Z")

</div>

How about locating your katalon-keywords-0.0.2.jar into the `Drivers` folder rather than `Plugins` folder. It may work.

---

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 13, 2022, 12:53pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/8 "2022-05-13T12:53:02Z")

</div>

> [@kazurayam](#):
>
> By the way, do you really need CustomKeyword.groovy?

Yes, we need use Custom keyword logic. I totally understand what you mean. But our main users who use Katalon are testers. And these guys hasn’t knowledge about programming. So they use Katalon Studio UI and add each command via tables (manual tab) in Katalon Studio. It was one of main reasons, why we choose this product.

> [@kazurayam](#):
>
> How about locating your katalon-keywords-0.0.2.jar into the `Drivers`

When I place JAR file to `Drivers` instead of `Plugin`, Katalon Engine show same error. Katalon Studio run tests but didn’t suggest our custom keywords in manual adding. So this is not the way for ours.

Thanks.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 13, 2022, 9:54pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/9 "2022-05-13T21:54:50Z")

</div>

> [@roman.jaros](#):
>
> About first reply. I know the error looks like second case. But it is case number 1. File is not created on remote machine.

I guess that Katalon Runtime Engine generated the `CustomKeywords.groovy` file and saved somewhere you do not expect it to.

I guess so because the `-projectPath` parameter you give in the command line looks strange to me.

> [@roman.jaros](#):
>
> -projectPath=“C:\jenkins..\workspace\_gradle\_keywords\katalon-gpk.prj”

---

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 13, 2022, 11:57pm UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/10 "2022-05-13T23:57:03Z")

</div>

> [@kazurayam](#):
>
> I guess so because the `-projectPath` parameter you give in the command

Sorry, the path is without dots. I just anonymize information, because this is public site. So, the path is `-projectPath=“C:\jenkins\<some folders>\workspace_gradle_keywords\katalon-gpk.prj”`

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 14, 2022, 12:02am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/11 "2022-05-14T00:02:28Z")

</div>

> [@kazurayam](#):
>
> I guess that Katalon Runtime Engine generated the `CustomKeywords.groovy` file and saved somewhere you do not expect it to.

Do you find the `CustomKeywords.groovy` file anywhere?

---

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 14, 2022, 12:17am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/12 "2022-05-14T00:17:19Z")

</div>

> [@kazurayam](#):
>
> Do you find the `CustomKeywords.groovy` file anywhere?

Unfortunately didn’t find.

---

<div class="post-metadata">

**Author:** ![roman.jaros](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/roman.jaros/32/16104_2.png) [@roman.jaros](https://forum.katalon.com/u/roman.jaros)\
**Post date:** [May 20, 2022, 6:07am UTC](https://forum.katalon.com/t/katalon-engine-not-correctly-load-custom-keyword-plugin/65028/13 "2022-05-20T06:07:54Z")

</div>

Hi, any update? Thanks.
