Forum Discussion
Were you able to find the resolution of your problem? I am facing the same problem but com.eviware.soapui.support.ClasspathHacker.addURL( new URL("jar file") ) is not working for me. I am still getting the same error.
- BhuvaneshMani9 years agoNew Contributor
I am not sure if you have added correct path provided in "jar file" in below line.
com.eviware.soapui.support.ClasspathHacker.addURL( new URL("jar file") )
I tried with below code and it worked.
Note: We require different set of jar files for different projects created in SOAP UI and hence we maintain the folder "jars" is same location of project xml and put all required jars inside jars folder.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def classpathHacker = new com.eviware.soapui.support.ClasspathHacker() path = groovyUtils.getProjectPath() myfile = new java.io.File(path + "/jars/ojdbc7.jar") mystring = "file://" + path + "/jars/ojdbc7.jar" classpathHacker.addFile( myfile ) classpathHacker.addURL( new URL(mystring))
- rupert_anderson9 years agoValued Contributor
Thats a fair point about needing a different set of jars per project, the /ext folder configuration is more of a global option. Athough, when running SoapUI from scripts (like Maven) the -Dsoapui.ext.libraries= could always be set to the project location when running each project.
Interesting option that ClasspathHacker anyway, so thanks for sharing the solution :-)
- nmrao9 years agoChampion Level 3Though different jar files are needed in different projects, it should not be a point of concern as long as there is no conflict in the classes.
As @ruper_anderson pointed you can pass system properties to override for particular project while running from CI tools or from ant or from testrunner utility.
- rupert_anderson9 years agoValued Contributor
Hi,
In terms of setting an alternative location for the /ext folder (where jar files like drivers should normally be placed), I have previously just changed where SoapUI expects to find this folder by changing the following parameter:
-Dsoapui.ext.libraries=$SOAPUI_HOME/bin/ext
You can see that SoapUI also uses this parameter in its start scripts e.g. /java/app/bin/soapui.sh
if [ $SOAPUI_HOME != "" ] then JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.libraries=$SOAPUI_HOME/bin/ext" JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.listeners=$SOAPUI_HOME/bin/listeners" JAVA_OPTS="$JAVA_OPTS -Dsoapui.ext.actions=$SOAPUI_HOME/bin/actions" JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$SOAPUI_HOME/bin" JAVA_OPTS="$JAVA_OPTS -Dwsi.dir=$SOAPUI_HOME/wsi-test-tools" # uncomment to disable browser component # JAVA_OPTS="$JAVA_OPTS -Dsoapui.browser.disabled=true" fi
Something similar works if running SoapUI via Maven e.g.
mvn integration-test "-Dsoapui.ext.libraries=src/test/resources"
This isn't an answer to your ClasspathHacker issue, but does this help?
Cheers,
Rupert
Related Content
- 2 months ago
- 4 years ago
- 4 years ago
- 3 years ago
Recent Discussions
- 15 years ago