Forum Discussion

RPriya's avatar
RPriya
New Contributor
4 years ago

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) )

  • ZDGN's avatar
    ZDGN
    Contributor

    Hi RPriya

     

    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."

    https://www.oracle.com/java/technologies/javase/v9-issues-relnotes.html 

     

    It seems that nobody found a real solution since Java 9 version.
    You can have a look at the last message of this thread:

    https://community.oracle.com/tech/developers/discussion/4011800/base-classloader-no-longer-from-urlclassloader 
    And try to find a workaround, but I suggest you ask from help to the Smartbear support team.

     

     

    David.

    • RPriya's avatar
      RPriya
      New Contributor

      Hi David,

      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.

       

      Cheers

       

  • beto26's avatar
    beto26
    Occasional Visitor

    I'm also facing this issue, are there any workarounds for it? I do not have access to modify the ext folder on my work laptop.

    • RPriya's avatar
      RPriya
      New Contributor

      Hi,

      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.