# Groovy Error: Unable to resolve class internal.GlobalVariable

**URL:** <https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557>\
**Category:** Bug Report\
**Tags:** compiler, bugs-report, katalon-studio\
**Created:** [February 28, 2018, 1:42pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557 "2018-02-28T13:42:04Z")\
**Posts on this page:** 20\
**Page:** 8

<div class="post-metadata">

**Author:** ![Amar\_nadh](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Amar\_nadh](https://forum.katalon.com/u/Amar_nadh)\
**Post date:** [November 26, 2018, 10:21am UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/141 "2018-11-26T10:21:30Z")

</div>

Hi,

I am facing the same error in Katalon\_Studio\_Windows\_64-5.8.5.

```auto
unable to resolve class internal.GlobalVariable04:20:53 @ line 14, column 1.04:20:53 import internal.GlobalVariable as GlobalVariable04:20:53 ^

```

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [November 26, 2018, 12:52pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/142 "2018-11-26T12:52:11Z")

</div>

does anybody read the previous posts and attempting to apply the proposed workaround/fixes?  
or this post is just about complaining and just waiting for the god’s to fix the issues?

by this way, the development team will never figure out what is the actual problem … so, yeah. keep up the good work.  
good job you do, dear katalon users …

---

<div class="post-metadata">

**Author:** ![manoj1](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@manoj1](https://forum.katalon.com/u/manoj1)\
**Post date:** [November 29, 2018, 8:19pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/143 "2018-11-29T20:19:14Z")

</div>

It seems that the latest 5.9.1 has the fix for this issue based on release notes. I tried upgrading my version from 5.8.0 to 5.9.1 on OS : MacOS High Sierra 10.13.6 but Upgrade failed with below error

**Unable to download update file from Katalon server**

**java.io.FileNotFoundException: [http://s3.amazonaws.com/katalon/update/5.9.1/macosx-x86\_64/contents.tar.gz](http://s3.amazonaws.com/katalon/update/5.9.1/macosx-x86_64/contents.tar.gz)**

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [November 30, 2018, 2:37am UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/144 "2018-11-30T02:37:22Z")

</div>

> [manoj](https://forum.katalon.com/profile/13489/manoj) said:
> 
> It seems that the latest 5.9.1 has the fix for this issue based on release notes. I tried upgrading my version from 5.8.0 to 5.9.1 on OS : MacOS High Sierra 10.13.6 but Upgrade failed with below error
> 
> **Unable to download update file from Katalon server**
> 
> **java.io.FileNotFoundException: [http://s3.amazonaws.com/katalon/update/5.9.1/macosx-x86\_64/contents.tar.gz](http://s3.amazonaws.com/katalon/update/5.9.1/macosx-x86_64/contents.tar.gz)**

We’ve fixed this issue. Somehow this file is not stored on the server when we upload it, so we’ve re-uploaded it to correct this issue.

Thanks for your report.

Regards

---

<div class="post-metadata">

**Author:** ![phuonglam](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@phuonglam](https://forum.katalon.com/u/phuonglam)\
**Post date:** [December 28, 2018, 11:36am UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/146 "2018-12-28T11:36:45Z")

</div>

Hi,

I meet the same issue in Katalon 5.10.0. First of all, when I’m running test suites inside Katalon Studio, everything is fine. But when running in console mode, it throws error:

`Groovy:unable to resolve class internal.GlobalVariable`

However, it’s still able to run the tests. But when coming back to Katalon Studio, I’m not able to run any test cases or test suites because of the error:  
`java.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariable`

Can anybody help me?

Updated: If reopen Katalon Studio, I can run everything again. However, I thinks it’s still an annoying bug and should be fixed.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 3:11pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/147 "2019-01-17T15:11:51Z")

</div>

I hate to exhume this ugly and dreadful thread but seems I have to.

I’m running KS **5.4.2** because of this bug. Yes, I know, that’s **_ancient_** , but I have no choice due to time constraints.

I tried updating to 5.8.x a while back and gave up trying to resolve this issue.

This morning I tried 5.10.1 thinking "surely they’ve fixed this problem by now?”

Nope: “Could not initialize class internal.GlobalVariable” and “cannot resolve class internal.GlobalVariable” etc (I may have mixed up the initialize/resolve elements but you get the idea).

**When oh when is this god-forsaken bug going to be fixed?** 😡

Sorry. I’m angry. Another two hours of my life I won’t get back.

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [January 17, 2019, 4:52pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/148 "2019-01-17T16:52:05Z")

</div>

In 5.10.2 it’s supposed to be just a warning without any real effect. Did your execution finish successfully?

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 5:28pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/149 "2019-01-17T17:28:39Z")

</div>

@devalex88

Thanks Alex.

No, it bombs out even before the test gets going.

I tried a simplistic test, something like:

```auto
WebUI.openBrowser("www.google.com")

```

which worked as you said but with a bunch of red lines (all of which will appear in reports so that’s not usable). But none of my tests run – they bomb out on custom classes and never get to a real test case line.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [January 17, 2019, 5:54pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/150 "2019-01-17T17:54:44Z")

</div>

While I haven’t followed this topic for a while (and there’s no way I have time to read through it again 😑), I’d like to take a shot in the dark and share what worked for me way back in June of last year. I haven’t experienced this issue in any release since 5.5.

In the file explorer, navigate to your project folder and delete the following items (no risk here, these will get re-built once you reopen the project in the Studio):

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/5/529ec20813edde283262911b5bb033867ebcc921.png)

Then, try downloading the latest release (5.10.1 still I believe?) and open your project (it may take longer than normal to open, as you’ll see that these 4 directories are getting rebuilt, among other things), and run your script(s). @Russ_Thomas I’m curious to see if that makes any difference for you, as I’ve used it as a cure-all of sorts whenever the studio is acting strangely. Again, a shot in the dark, but it works for me 🙂

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 7:44pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/152 "2019-01-17T19:44:08Z")

</div>

> [@Brandon\_Hein](#):
>
> In the file explorer, navigate to your project folder and delete the following items …

Okay, I’m biting the proverbial bullet…

Looks to be the same. I cleared the files/folders as you suggested, Brandon. I tried running a single real-world test and got this immediately:

 ![5-10-1-pic1](https://europe1.discourse-cdn.com/katalon/original/2X/1/11558b6dde833ff98b487c244fd9e542e97773e5.jpeg)

I clicked “Proceed” and bang.

SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]  
SLF4J: See [SLF4J Error Codes](http://www.slf4j.org/codes.html#version_mismatch) for further details.  
2019-01-17 13:55:00.678 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39m--------------------e[0;39m  
2019-01-17 13:55:00.681 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mSTART Test Cases/Pages/Misc/Test Access The Big Foure[0;39m  
2019-01-17 13:55:01.135 e[1;31mERRORe[0;39m e[36mc.k.k.core.context.internal.TestHooker -e[0;39m e[31m❌ org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.Error: Unresolved compilation problem: e[0;39m  
2019-01-17 13:55:01.281 e[1;31mERRORe[0;39m e[36mc.k.k.core.context.internal.TestHooker -e[0;39m e[31m❌ org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariablee[0;39m  
2019-01-17 13:55:01.725 e[39mDEBUGe[0;39m e[36mtestcase.Test Access The Big Four -e[0;39m e[39m1: trye[0;39m  
2019-01-17 13:55:01.726 e[39mDEBUGe[0;39m e[36mtestcase.Test Access The Big Four -e[0;39m e[39m1: home = new com.xxxxxx.home()e[0;39m  
2019-01-17 13:55:01.779 e[1;31mERRORe[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[31m❌ try FAILED.e[0;39m  
e[31mReason:e[0;39m  
e[31mjava.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariable

I think we can safely ignore the first two (right @devalex88?)

This seems a little more readable. Note the base classes and complaints from java:

```auto
try FAILED.
Reason:
java.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariable
	at com.xxxxxx.basePage.<init>(basePage.groovy:50)
	at com.xxxxxx.home.<init>(home.groovy)
	at Test Access The Big Four.run(Test Access The Big Four:110)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1547754895203.run(TempTestCase1547754895203.groovy:22)

```

Out of pure inquisitiveness, I repeated the exercise: closed down Katalon, killed the bin and libs folders and the .classpath and .project files and tried again.

This time I saw this during loading of the project:

 ![5-10-1-pic2](https://europe1.discourse-cdn.com/katalon/original/2X/9/9b851c764fd6a66ce526ec2a68e51093ed1dec95.jpeg)

It sat there for almost three minutes (I watched the clock for over two of those minutes). Then , just as I was reaching for my gun, the project came up.

Ran the same test, got the same error.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [January 17, 2019, 9:07pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/154 "2019-01-17T21:07:39Z")

</div>

Do you consistently get the “Errors in Workspace” dialog? If so, you should check the Problems tab and resolve any compilation errors. Basically by deleting those directories and reopening the project, you’re recompiling all of the project code from source, which is why you get the “Building workspace” dialog and the project takes longer to open.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 9:16pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/155 "2019-01-17T21:16:10Z")

</div>

> [@Brandon\_Hein](#):
>
> Do you consistently get the “Errors in Workspace” dialog?

No.

> [@](#):
>
> If so, you should check the Problems tab and resolve any compilation errors.

I did. Empty. Plus, of course, this project compiles and runs fine each time I revert to 5.4x and runs on my real dev env (I’m testing this 5.10 release on a clean env on a win10 laptop).

Crazy.

Hey - thanks for your diligence, Brandon.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [January 17, 2019, 9:30pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/156 "2019-01-17T21:30:38Z")

</div>

Alright, one last stab at it, then I’ll leave it to the devs and stop chirping 😄 This is actually from early on in this same topic:

> [@Groovy Error: Unable to resolve class internal.GlobalVariable](http://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/12):
>
> Viktors Arzanajevs said: See here: [Override profiles in Test Suite Collection in CLI mode - #14 by Viktors\_Arzanajevs - Feature Requests - Katalon Community](http://forum.katalon.com/discussion/comment/16316/#Comment_16316) This will work if you have the GlobalVariable.groovy file already in your project. If you’re like me, however, and you have the Lib folder removed from your project folder for whatever reason (for me, it’s specified in the .gitignore file for our repo, and thus not included when cloning), you can do the following as a workaround: 1.) C…

but the general idea is still the same. The GlobalVariable.groovy file should live in the directory path/to/my/project/Libs/internal:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/9/964b77386ab2fb4744dc0c7e413ead586d8e79da.png)

If it isn’t there (for whatever reason, who knows), try creating a new project, grab the GlobalVariable.groovy file from that same directory in the new project, and pasting it back into yours. It can then be picked up by the compiler and added to your project.

Hope I’m not being overbearing here, I just remember how frustrating this particular issue was for me, and looks like continues to be for others. 😣

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 9:33pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/157 "2019-01-17T21:33:39Z")

</div>

> [@Brandon\_Hein](#):
>
> Hope I’m not being overbearing here,

Hell no.

> [@](#):
>
> I just remember how frustrating this particular issue was for me, and looks like continues to be for others

Precisely. It’s the most enduring/embarrassing bug on the forum and has been for waaaay too long.

Trying your last, now…

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 17, 2019, 9:41pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/158 "2019-01-17T21:41:19Z")

</div>

Nope. `GlobalVariable.groovy` was present in the libs\internal folder.

I went through the exercise anyway, watched Katalon overwrite the default 2KB file with mine as it rebuilt it from my project’s profile. Same issue.

Looks like I’m stuck with 5.4x. Again. Shame.

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [January 18, 2019, 12:49am UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/159 "2019-01-18T00:49:12Z")

</div>

Thank you @Russ_Thomas @Brandon_Hein. My previous comment is for command line mode. May I see your `internal.GlobalVariable` content (without any modification)? It might help us fix this bug for good. You can send it to [info@katalon.com](mailto:info@katalon.com).

---

<div class="post-metadata">

**Author:** ![YoungNgo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/youngngo/32/15132_2.png) [@YoungNgo](https://forum.katalon.com/u/YoungNgo)\
**Post date:** [January 18, 2019, 4:01am UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/160 "2019-01-18T04:01:48Z")

</div>

Dear @Russ_Thomas,

We have recently had some updates in 5.11 to deal with this issue. Will send you the beta package for verifying soon.

Best regards,

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 21, 2019, 4:55pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/161 "2019-01-21T16:55:10Z")

</div>

Tested 5.11.0-beta. Exactly the same result as 5.10x 😭

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [January 21, 2019, 6:37pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/162 "2019-01-21T18:37:01Z")

</div>

@Russ_Thomas I’m still pretty convinced that there’s some discrepancy between your particular project code and the later versions of the studio. If you **create a brand new project in 5.10.1** (or the 5.11.0 beta), and write a quick test case that somehow uses the GlobalVariable class, I’m almost positive you will not have a problem. Maybe this would test it?:

1.) Add a test url in the default profile:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/a/a2d39032aff454acf404a5e44a2cb4fb63cb90a0.png)

2.) Simple test case that uses this var:

```
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(GlobalVariable.url);

```

If that works, then in my mind the best path forward would be to generate a brand new project using 5.10.1, then bring all of your current project code into the new project. Tedious for sure, but it might be the best option.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [January 21, 2019, 7:44pm UTC](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/163 "2019-01-21T19:44:01Z")

</div>

Thanks.

> [@Brandon\_Hein](#):
>
> I’m still pretty convinced that there’s some discrepancy between your particular project code and the later versions of the studio.

Yes, me too, Brandon. But…

1 - It’s legal groovy (we think)  
2 - Katalon (@YoungNgo and @devalex88) have my GlobalVariable stuff to dissect.

Plus they’re welcome to log on to my box anytime (as Dung has done before).

Dung was hopeful that .11 might inch them closer to finding the cause but on the face of it (the results anyway) I don’t see any change.

For now, I’m content and in favor of letting them debug it while longer.

If I had the time (because I’m a crazy person) I’d consider loading old versions one-by-one to do a proper “which version killed me” test. That way they might get closer to a series of suspect commits. But I don’t have that time, right now.

Having said all of that, I’m slowly removing ALL GVs (only about half dozen to go). Then we’ll see if the GV complaint is real or just a symptom of something else (obviously, that would be the worst scenario).

Thanks again.

[Previous page](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557.md?page=7)

[Next page](https://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557.md?page=9)
