Unable to resolve class internal.GlobalVariable (Again)

What is the “STRG” key ?

Oh sorry, German keyboard :wink:

The shortcut is CTRL + SHIFT + O

1 Like

there are plenty discussions on the GlobalVariable class voodo.
some were serious, some were solved.
but even in the last version, the import of the internal global blah class when generating a new keyword is there …

perhaps i missunterstud some concepts but, i will ask again the development team and other god users:

“why would somebody want to use global variables by default in a keyword class? aka why the template is adding that import by default?”

@devalex88 @Trong_Bui @Russ_Thomas @kazurayam @anyone_else_with_better_java_understanding

after we find the answer, the second question:
“why don’t we have a feature to propose class optimization when hitting save … aka get rid of unused imports?”

may be usefull for scripts too … just saying …

Maybe some developer create a plugin with this functionality, if the katalon core development team don’t like it?

1 Like

ooor maybe some developers should start to use linters? in python,with decent level settings,such issue will never pass a pull request …

Oh please… I’m not a “god user”. My use and expertise within Katalon Studio is very limited. But thanks for the compliment :blush:

And guess what… I’m getting the same error (yet again). But this time, it has me completely stumped - it makes no sense (at least, I can’t make sense of it).

I have a couple of suites that run fine in the IDE and via CLI. They work fine on TWO different machines. On a third and fourth machine,

Generating global variables...
/D%%softwareDev%branches%2018.05.15.stableRelease.RelBranch%KatTests%xxx V9%
xxx v9.prj/Keywords/com/xxxx/base/baseGrid.groovy: 12 Groovy:unable to resolve class internal.GlobalVariable

And a ton more just like that.

Call out to other god users @Brandon_Hein @Marek_Melocik @Andrej_Podhajsky @YoungNgo

(Win10, Win7, Win8, KS 6.1.2)

My guess: This is just their way of trying to reduce the complexity for new users, who may or may not have a firm understanding of how to import things themselves. This would also support users who do a lot of record/playback.

Your argument could be said about ALL of the default imports.

2 Likes

Hmmm again, I think the root of this problem comes down to how Katalon is invoked from CLI. In the old days, I think that the user was required to open their project in the studio at least once on the target machine, which would allow the compiler to do its thing (including generating the binary of the GlobalVariable.groovy file). More recently, I believe that the command now attempts to do this for you. I will look at this more closely when I get into the office :upside_down_face:

2 Likes

let’s focus first on the anoying one. later we can discuss what can be further improved. thank you for your dedication :slight_smile:

in the eyes of visual impaired, the one eye is ‘seen’ like a god :smiley:

Oh I totally agree that it’s annoying (actually, a better word would be “unnecessary” imo). If it were up to me, new keywords would not import anything by default at all. I was simply giving my guess to the answer for your question of:

Here’s a snippet of the console log from a Jenkins execution on a remote machine:

[EL Warning]: 2019-06-18 00:00:50.656–Ignoring attribute [lastRun] on class [TestSuiteEntity] as no Property was generated for it.
Delete folder: bin
Delete folder: Libs
Opening project file: C:\projects\qa-katalon\master.prj
Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
166 2.4.7.xx-201611170128-e46 = ACTIVE
Proxy found for HTTP @ 192.168.11.17:8080.
Request sent successfully.
Parsing custom keywords…
00:00:57.859 [Worker-0] DEBUG org.eclipse.jgit.util.FS - readpipe [git, --version],C:\Users\hei09463\Desktop\Brandon’s Folder\Git\cmd
00:00:58.155 [Worker-0] DEBUG org.eclipse.jgit.util.FS - readpipe may return ‘git version 2.17.0.windows.1’
00:00:58.155 [Worker-0] DEBUG org.eclipse.jgit.util.FS - remaining output:

00:00:58.155 [Worker-0] DEBUG org.eclipse.jgit.util.FS - readpipe [git, config, --system, --edit],C:\Users\hei09463\Desktop\Brandon’s Folder\Git\cmd
00:00:58.390 [Worker-0] DEBUG org.eclipse.jgit.util.FS - readpipe may return ‘C:/Users/hei09463/Desktop/Brandon’s Folder/Git/mingw64/etc/gitconfig’
00:00:58.390 [Worker-0] DEBUG org.eclipse.jgit.util.FS - remaining output:

Generating global variables…
Project ‘master’ opened

As I suspected, katalon.exe attempts to recompile your project at runtime (see bold lines from above). I wonder if, when you run from CLI on the machine(s) you are having issues with, that the log doesn’t contain these lines… Maybe there are errors?

Also FYI, I’m still using an older version of the studio (5.10.1) in the above log. Slap on the wrist… I know… :confused:

Thanks for that Brandon…

It then goes on to crash out (not always in the same way). Most recent I have is the following – but note the complaint about “$” again – I thought we’d killed that thing few releases back. I guess it might just be a symptom, not a real cause…

Project 'blah' opened
joptsimple.IllegalOptionSpecificationException: $ is not a legal option characte
r
        at joptsimple.ParserRules.ensureLegalOptionCharacter(ParserRules.java:77
)
        at joptsimple.ParserRules.ensureLegalOption(ParserRules.java:67)
        at joptsimple.ParserRules.ensureLegalOptions(ParserRules.java:72)
        at joptsimple.OptionParser.acceptsAll(OptionParser.java:267)
        at joptsimple.OptionParser.acceptsAll(OptionParser.java:260)

Again, that’s not typical or consistent.
Again, this works apart from two remote-from-me boxes which can run the suites in the IDE.

All of the “unable to resolve” logs point to one or more compilation issues (I’m pretty sure). I wonder if the logs for the studio instance on the remote boxes have some clues?:

path/to/studio/folder/config/.metadata/.log

1 Like

hello,
i have deleted folders mentioned in above, no suceess
my Jenkins build fail
In linux env using
Katalon_Studio_Linux_64-5.8.6

and in development env OS Windows using
version 6.1.5

this is very annoying issue

because (of) (Stack trace: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariable
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:144)
at paymentWeb.Visa3dCard.invokeMethod(Visa3dCard.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:46)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at Script1561023698698.run(Script1561023698698.groovy:19)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:142)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at TempTestSuite1561027235714.run(TempTestSuite1561027235714.groovy:36)

No issues in my Windows Katalon Studio

i closed this as it is inactive