Forum Discussion

euthenia's avatar
euthenia
Occasional Contributor
13 years ago

NPE when calling REST service that returns a 204 response

I have a suite of soapUI tests that I am using the maven-soapui-plugin (version 4.0.1) to run as part of an automated regression test.

The first call is to a REST web service that returns a HTTP 204 (No Content) response on success. This successfully runs in soapUI 4.0.1 with no errors reported, but when it's run by the maven plugin a NullPointerException is reported as per the following stack trace:

11:24:59,250 ERROR [SoapUITestCaseRunner] Error saving failed result: java.lang.NullPointerException
java.lang.NullPointerException
at java.lang.String.<init>(String.java:593)
at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210)
at com.eviware.soapui.tools.SoapUITestCaseRunner.afterStep(SoapUITestCaseRunner.java:695)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:244)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


The return from the web service that is shown in soapUI when the test is run in there is:

HTTP/1.1 204 No Content
Date: Fri, 27 Jan 2012 11:42:53 GMT
Server: Apache
Content-Length: 0
Connection: close
Content-Type: text/xml

The NPE does not prevent the test from continuing, but it does mean that the log files output by the maven plugin contain errors that are not genuine errors.

Is this likely to be fixed in a future release?

Thanks,
Ed

2 Replies

  • jebouk's avatar
    jebouk
    Occasional Contributor
    Same problem here!

    This is a big issue since may rest successful deletes returns 204
  • soapuifan's avatar
    soapuifan
    Occasional Contributor
    Hi,
    anybody can answer? Is this bug fixed?

    I have the same issue, when using RunTestCase step (component)... in test scenarios.
    everything seems to go well if I run the scenario from gui...
    but using testrunner the logs shows:

    13:41:35,219 ERROR [SoapUITestCaseRunner] Error saving failed result: java.lang.NullPointerException
    java.lang.NullPointerException
    at java.lang.String.<init>(String.java:593)
    at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210)
    at com.eviware.soapui.tools.SoapUITestCaseRunner.afterStep(SoapUITestCaseRunner.java:695)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:244)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    13:41:35,219 ERROR [SoapUITestCaseRunner] Error saving failed result: java.lang.NullPointerException
    java.lang.NullPointerException
    at java.lang.String.<init>(String.java:593)
    at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210)
    at com.eviware.soapui.tools.SoapUITestCaseRunner.afterStep(SoapUITestCaseRunner.java:695)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:244)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)