NullPointerException when logging HTTP Request results
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2012
03:33 AM
03-19-2012
03:33 AM
NullPointerException when logging HTTP Request results
Hello,
I encountered a NullPointerException and suppose this is a bug (if it's something I've done wrong I am sure you will tell me 🙂 ).
The situation is as follows:
- TestCase A sends an HTTP request (not SOAP) to a remote server
- TestCase B calls A and provides some parameters (A is a generic test case)
- in the project settings I created an afterStep event that logs the outcome of each test step, just as proposed here: http://www.soapui.org/Scripting-Propert ... ng-results
When I call TestCase B, a NullPointerException is being thrown during the logging event as follows:
Some more information:
- The Exception does not occur when I run TestCase A directly, nor on any other test step type.
- This seems to be independent of the utilized HTTP method (tested GET and POST).
- I also have a similar situation in the same project where I use a SOAP request instead of HTTP. There it does work, so the problem is limited to the HTTP Test Request step.
- The HTTP request for now simply targets an Apache Tomcat index page, so there is a valid HTML response.
- soapUI version is 4.0.1 pro (Build dist-142-2011-09-14, Build Date 2011/09/14 13:38)
Thank you in advance for your help. Please let me know if you need further information.
I encountered a NullPointerException and suppose this is a bug (if it's something I've done wrong I am sure you will tell me 🙂 ).
The situation is as follows:
- TestCase A sends an HTTP request (not SOAP) to a remote server
- TestCase B calls A and provides some parameters (A is a generic test case)
- in the project settings I created an afterStep event that logs the outcome of each test step, just as proposed here: http://www.soapui.org/Scripting-Propert ... ng-results
filePath = 'c:/testresults'
fos = new FileOutputStream( filePath + testStepResult.testStep.label + '.txt', true )
pw = new PrintWriter( fos )
testStepResult.writeTo( pw )
pw.close()
fos.close()
When I call TestCase B, a NullPointerException is being thrown during the logging event as follows:
Mon Mar 19 11:14:42 CET 2012:ERROR:java.lang.NullPointerException
java.lang.NullPointerException
at java.lang.String.<init>(Unknown Source)
at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:210)
at com.eviware.soapui.model.testsuite.TestStepResult$writeTo.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at com.eviware.soapui.model.testsuite.TestStepResult$writeTo.call(Unknown Source)
at Script62.run(Script62.groovy:8)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:88)
at com.eviware.soapui.eventhandlers.support.DefaultSoapUIScript.invoke(SourceFile:47)
at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(SourceFile:29)
at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(SourceFile:73)
at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(SourceFile:49)
at com.eviware.soapui.eventhandlers.impl.EventHandlersTestRunListener.afterStep(SourceFile:41)
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(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Some more information:
- The Exception does not occur when I run TestCase A directly, nor on any other test step type.
- This seems to be independent of the utilized HTTP method (tested GET and POST).
- I also have a similar situation in the same project where I use a SOAP request instead of HTTP. There it does work, so the problem is limited to the HTTP Test Request step.
- The HTTP request for now simply targets an Apache Tomcat index page, so there is a valid HTML response.
- soapUI version is 4.0.1 pro (Build dist-142-2011-09-14, Build Date 2011/09/14 13:38)
Thank you in advance for your help. Please let me know if you need further information.
7 REPLIES 7
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2012
04:03 PM
03-20-2012
04:03 PM
Hi,
thanks for this - it is a bug that should be fixed in the 4.5 beta version, can you give that a try to confirm?
regards,
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
thanks for this - it is a bug that should be fixed in the 4.5 beta version, can you give that a try to confirm?
regards,
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2012
03:01 AM
03-21-2012
03:01 AM
Hello Ole,
thanks for your answer. I installed 4.5.0 beta2 in the meantime, but the problem still persists. If you were referring to viewtopic.php?f=13&t=12507 it might be worthwhile to glimpse at the differences between these problems, which are "vanilla" HTTP vs. REST and HTTP status 200 vs. 204 in the other post.
thanks for your answer. I installed 4.5.0 beta2 in the meantime, but the problem still persists. If you were referring to viewtopic.php?f=13&t=12507 it might be worthwhile to glimpse at the differences between these problems, which are "vanilla" HTTP vs. REST and HTTP status 200 vs. 204 in the other post.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2012
03:55 AM
03-21-2012
03:55 AM
Hi!
hmm.. can you show the stacktrace you are getting with the 4.5 beta?
thanks!
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
hmm.. can you show the stacktrace you are getting with the 4.5 beta?
thanks!
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2012
04:04 AM
03-21-2012
04:04 AM
Hello Ole,
of course, here it is:
(the line number in RestRequestStepResult.java has changed, but else the exception seems to be the same)
of course, here it is:
Wed Mar 21 12:01:10 CET 2012:ERROR:java.lang.NullPointerException
java.lang.NullPointerException
at java.lang.String.<init>(Unknown Source)
at com.eviware.soapui.impl.wsdl.teststeps.RestRequestStepResult.writeTo(RestRequestStepResult.java:223)
at com.eviware.soapui.model.testsuite.TestStepResult$writeTo.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at com.eviware.soapui.model.testsuite.TestStepResult$writeTo.call(Unknown Source)
at Script1.run(Script1.groovy:8)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
at com.eviware.soapui.eventhandlers.support.DefaultSoapUIScript.invoke(SourceFile:47)
at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(SourceFile:29)
at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(SourceFile:73)
at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(SourceFile:49)
at com.eviware.soapui.eventhandlers.impl.EventHandlersTestRunListener.afterStep(SourceFile:41)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:250)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:147)
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(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
(the line number in RestRequestStepResult.java has changed, but else the exception seems to be the same)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2012
04:47 AM
03-21-2012
04:47 AM
Hi,
Thanks! I've fixed this one now - unfortunately you will have to wait until the final 4.5 to try it out.
regards!
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Thanks! I've fixed this one now - unfortunately you will have to wait until the final 4.5 to try it out.
regards!
/Ole
SmartBear Software
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2012
01:01 AM
03-22-2012
01:01 AM
OK - thanks and good luck

- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2012
01:53 AM
04-24-2012
01:53 AM
Hello,
Can you confirm this now working for you?
robert
/Smartbear
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Can you confirm this now working for you?
robert
/Smartbear
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
