TestProject Forum

TestProject Platform => TestProject SDK => Topic started by: vuckonem on July 31, 2018, 21:34:45 pm

Title: Getting java.lang.ClassNotFoundException when using Addon Proxy
Post by: vuckonem on July 31, 2018, 21:34:45 pm
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?

Title: Re: Re: Re: Using actions in test files
Post by: Marat Strelets on July 31, 2018, 21:40:58 pm
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.

Title: Re: Re: Re: Using actions in test files
Post by: Marat Strelets on August 01, 2018, 15:38:09 pm
Locked due to inactivity.