We are trying to migrate to Katalon 8.3.5 from Katalon 7.7. 2. On executing any test case in Katalon 8.3.5 I am getting the message ‘’ java.lang.SecurityException: Prohibited package name: java.lang"
java.lang.string is not used in our keywords, but is generated in .cache on opening the project in katalon 8.3.5
Console log:
java.lang.SecurityException: Prohibited package name: java.lang
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:656)
at java.lang.ClassLoader.defineClass(ClassLoader.java:755)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:175)
at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:175)
at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:138)
I have already tried these steps. But after opening the project in Katalon 8.3.5; .cache folder is getting created with the package java.lang in some of the keywords
this is the time when you have to share your code.
seriously, your new cache contains stuff which are not present in your code?
hard to accept such, at least from my side…
Apparently, is generated at compile time from the method declaration (which looks OK at first look):
def sortIntegerAscending(String xpath_List){
I will try to import your keyword to see If i can reproduce the issue when I find some time.
What you can try in the mean time is, remove the String from the methods declaration.
Groovy works also without it, it will guess the parameter type.
Must dig also into some docs to see if any changes between groovy versions
LE: you can try also latest KS (8.4.0) … I have the feeling something has been changed in this version regarding cache …
well … i imported your keyword in 8.3.5 and made a simple testcase (is not using your keyword, have just a print)
I see the same generated in cache, but I got no errors when I ran my testcase.
So it must be something else specific with your environment …
side note, those three imports generated errors:
import MobileBuiltInKeywords as Mobile
import WSBuiltInKeywords as WS
import WebUiBuiltInKeywords as WebUI
but are not used in your class, so I had to remove them.
just hit Ctrl-Shift-O to make some cleanup in your scripts / keywords
LE: it works fine with 8.4.0 also …
So, it is not because what you see in the cache, but something else.
LLE: after i edited your keywords (removed the String type) i got something like this in the cache:
So you can try that also, but i doubt it will fix the main issue
Somewhere you have a wrong import perhaps.
There are any errors shown in the Problems tab?