Forum Discussion

chriscropley's avatar
chriscropley
Occasional Contributor
7 years ago
Solved

java.lang.NoClassDefFoundError: com/eviware/soapui/SoapUIProCore thrown when integrating with Java

I have been trying to integrate my intelliJ Java tests to execute some ReadyAPI test cases.  I have ReadyAPI! 2.1 installed and I have followed this https://support.smartbear.com/readyapi/docs/testing/integrations/junit.html guide to integrate the two.

 

Unfortunately when it comes to executing my Test from intelliJ I receive this stack trace.

 

java.lang.NoClassDefFoundError: com/eviware/soapui/SoapUIProCore

at com.intellihub.msats.automation.modules.ReadyAPI.RunReadyAPITestCase(ReadyAPI.java:11)
at com.intellihub.msats.automation.teststeps.BravoCATSCreation.createBravoCATS(BravoCATSCreation.java:10)
at com.intellihub.msats.automation.tests.BravoCATSTests.createCATSCR6800ReqOnly(BravoCATSTests.java:20)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: java.lang.ClassNotFoundException: com.eviware.soapui.SoapUIProCore
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 26 more

 

My simple test is:

 

package com.intellihub.msats.automation.tests;

import com.intellihub.msats.automation.modules.TestListener;
import com.intellihub.msats.automation.teststeps.BravoCATSCreation;
import io.qameta.allure.Description;
import io.qameta.allure.Epic;
import io.qameta.allure.Feature;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

@Listeners({ TestListener.class })
@Epic("eHUB B2B Integration")
@Feature("Service Order Tests")
public class BravoCATSTests extends BaseTest {

test(enabled = true, description = "Create CR6800 Req files only for NMI")
@Description("CCreate CR6800 Req files only for NMI")
public void createCATSCR6800ReqOnly(){
BravoCATSCreation bravoCATSCreation = new BravoCATSCreation();
bravoCATSCreation.createBravoCATS("6800ReqOnly");

}
}

 

Which calls...:

 

package com.intellihub.msats.automation.teststeps;

import com.intellihub.msats.automation.tests.BaseTest;
import com.intellihub.msats.automation.modules.ReadyAPI;

public class BravoCATSCreation extends BaseTest {

public void createBravoCATS(String testCase){
ReadyAPI readyAPI = new ReadyAPI();
readyAPI.RunReadyAPITestCase(testCase);
}

}

 

And then executes the good stuff...:

 

package com.intellihub.msats.automation.modules;


import com.smartbear.ready.cmd.runner.pro.*;

public class ReadyAPI {

public void RunReadyAPITestCase(String testCaseName){

try {
SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
//SoapUITestCaseRunner soapUITestCaseRunner = new SoapUITestCaseRunner();
runner.setProjectFile("src/test/resources/Bravo-readyapi-project.xml");
runner.setTestSuite("CATS");
runner.setTestCase(testCaseName);
runner.run();

} catch (Exception e) {
e.printStackTrace();
}
}
}

 

I have the following External Libraries on my class path soapui-5.3.0.jar and soapui-pro-5.1.2.jar

 

I have trawled the internet for a jar file with this class in it.  This page http://www.soapui.org/apidocs/pro/ also gives the indication it is in the jar file I have, however it is clearly not there.

 

Am I missing something simple?  I have seen other internet pages for different problems with stack traces that have this class being used.

 

Any pointers or help would be greatly appreciated.

 

Thanks,

 

Chris

  • I have discovered what the problem was.  I had not loaded all of the required lib files into my class path.

1 Reply

  • chriscropley's avatar
    chriscropley
    Occasional Contributor

    I have discovered what the problem was.  I had not loaded all of the required lib files into my class path.