TestProject Forum
Powered by leading experts in the test automation community

Getting java.lang.ClassNotFoundException when using Addon Proxy

Hi Marat,

Thank you for the answer, I managed to create proper JAR and to upload it to the addon.

Now I have a new issue, after I try to execute locally, through runner class, my new test with reference to addon action:

GetResultCount getResultCountAction = ExampleAddon.getGetResultCount();
StepExecutionResult executeRes = helper.executeProxy(getResultCountAction);

I get the following error in my console:

21:23:28.167 [main] DEBUG io.testproject.java.sdk.v2.Runner - Starting development session…
21:23:33.613 [main] INFO io.testproject.java.sdk.v2.Runner - Development session initialized
21:23:33.644 [main] INFO io.testproject.java.sdk.v2.Runner - Development session connection established via local.rdr.tpagent.io:64263
java.lang.NoClassDefFoundError: io/testproject/proxy/addon/io/testproject/examples/sdk/java/GetResultCount
at io.testproject.examples.sdk.java.TestRunnerGoogle.main(TestRunnerGoogle.java:23)
Caused by: java.lang.ClassNotFoundException: io.testproject.proxy.addon.io.testproject.examples.sdk.java.GetResultCount
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 1 more

Do you have any idea why this is happening?

I am glad it helped,

How did you reference the Action proxy JAR?
Did you add it to your build.gradle file as a local JAR file or via Eclipse?
If you run the Gradle debug tasks, you have to reference the proxy JAR via Gradle as well.

Thanks.

Locked due to inactivity.