Forum Discussion

Devakara's avatar
Devakara
Occasional Contributor
14 years ago

NoClassDefFoundError ModelItemConfig

Hi,

I am trying to run a particular test case in soapUI project XML, using simple/standalone Java class.
Code I used is:

public class RunSoapUIProject {

public static void main(String[] args) {
try {
String projectPath = "C:\\soap\\LP-soapui-project.xml";
WsdlProject project = new WsdlProject(projectPath);
List<TestSuite> testSuites = project.getTestSuiteList();
System.out.println(testSuites.toString());
// some useful code here
} catch (Exception e) {
e.printStackTrace();
}
}


This is throwing an Exception: java.lang.NoClassDefFoundError, when executing/initializing wsdl project.
(There are no compilation errors)
I have included soapui-3.0.1.jar and xmlpublic-2.4.0.jar in build path of this java project. Below is the exact exception message:

Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/config/ModelItemConfig

Could anyone look into this and let me know what is missing in my attempt, or should I include any other jar(s).

Thanks,
Devakara.

1 Reply

  • Devakara's avatar
    Devakara
    Occasional Contributor
    I tried adding jars present in soapUI installation’s lib one by one to build path of the Java class. Below is the list I tried to add manually one after the other.

    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/portlet-api-1.0.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/soapui-3.0.1.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xmlpublic-2.4.0.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/soapui-xmlbeans-3.0.1.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.14.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-httpclient-3.1.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-cli-1.0.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xbean-fixed-2.4.0.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xbean_xpath-2.4.0.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/groovy-all-1.6.4.jar"/>

    Even with this list, the class was throwing exceptions when executed. Finally I decided to add all the jars present in the soapUI lib to the build path of the project. After this the class was executed without any errors.

    I am not sure yet, whether we require all of those jars for initializing the WsdlProject.
    [WsdlProject project = new WsdlProject(projectPath);] But with all of lib's jars, there should not be any runtime errors.

    However if anyone knows the exhaustive list of jars required please reply.

    I shall be writing a detailed post about this in my blog.

    Thanks,
    Devakara.