Upgraded to SoapUI 5.6.0 - unable to load jar file
I imported the project developed in SoapUI 5.2.1 to the newer version 5.6.0. Unable to load my jar files using the existing and working script.
Error : Failed to add jar to jdk.internal.loader.ClassLoaders$AppClassLoader, trying parent
Code snippet as below :
def classpathHacker = new com.eviware.soapui.support.ClasspathHacker ()
myfile = new java.io.File(path + "/poi-ooxml-3.9.jar")
mystring = "file://" + path + "/poi-ooxml-3.9.jar"
classpathHacker.addFile( myfile ) // ---> Getting error in this line
com.eviware.soapui.support.ClasspathHacker.addFile( myfile )
com.eviware.soapui.support.ClasspathHacker.addURL( new URL(mystring) )
Your trouble may come from the java version update between SoapUI versions.
"The application class loader is no longer an instance of java.net.URLClassLoader (an implementation detail that was never specified in previous releases). Code that assumes that ClassLoader::getSytemClassLoader returns a URLClassLoader object will need to be updated. Note that Java SE and the JDK do not provide an API for applications or libraries to dynamically augment the class path at run-time."
It seems that nobody found a real solution since Java 9 version.
You can have a look at the last message of this thread:
And try to find a workaround, but I suggest you ask from help to the Smartbear support team.
Thanks for your kind reply. I am managing with the work around to keep the jar files in local path of SoapUI installation. So I can avoid loading them using script.
I am managing with the work around to keep the jar files in local path of SoapUI installation
e.g C:\Users\......\ProgramFilesX64\SmartBear\SoapUI-5.6.0\bin\ext folder where I have access. They are getting loaded during Soap UI start up itself. So I can avoid loading them using script.