Forum Discussion

bkbn16's avatar
bkbn16
Contributor
9 years ago

Cannot get property 'httpRequest' on null object

while running this program, I got this error ...

 

//Read request parameter test and assign value to a variable
def userValue = mockRequest.httpRequest.getParameter('test')
//Assign the input value to response contextcontext.requestValue = userValue 

 Cannot get property 'httpRequest' on null object 

 

Why am I seeing this error. The full error log is: 

 

  • Fri Jun 17 12:47:43 IST 2016:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException: Cannot get property 'httpRequest' on null object
  • com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException: Cannot get property 'httpRequest' on null object
  • at com.eviware.soapui.impl.wsdl.mock.dispatch.ScriptMockOperationDispatcher.selectMockResponse(ScriptMockOperationDispatcher.java:91)
  • at com.eviware.soapui.impl.wsdl.mock.dispatch.ScriptMockOperationDispatcher$RunScriptAction.actionPerformed(ScriptMockOperationDispatcher.java:219)
  • at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  • at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  • at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  • at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  • at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  • at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
  • at java.awt.Component.processMouseEvent(Unknown Source)
  • at javax.swing.JComponent.processMouseEvent(Unknown Source)
  • at java.awt.Component.processEvent(Unknown Source)
  • at java.awt.Container.processEvent(Unknown Source)
  • at java.awt.Component.dispatchEventImpl(Unknown Source)
  • at java.awt.Container.dispatchEventImpl(Unknown Source)
  • at java.awt.Component.dispatchEvent(Unknown Source)
  • at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  • at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  • at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  • at java.awt.Container.dispatchEventImpl(Unknown Source)
  • at java.awt.Window.dispatchEventImpl(Unknown Source)
  • at java.awt.Component.dispatchEvent(Unknown Source)
  • at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  • at java.awt.EventQueue.access$200(Unknown Source)
  • at java.awt.EventQueue$3.run(Unknown Source)
  • at java.awt.EventQueue$3.run(Unknown Source)
  • at java.security.AccessController.doPrivileged(Native Method)
  • at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  • at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  • at java.awt.EventQueue$4.run(Unknown Source)
  • at java.awt.EventQueue$4.run(Unknown Source)
  • at java.security.AccessController.doPrivileged(Native Method)
  • at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  • at java.awt.EventQueue.dispatchEvent(Unknown Source)
  • at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  • at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  • at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  • at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  • at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  • at java.awt.EventDispatchThread.run(Unknown Source)
  • Fri Jun 17 13:03:39 IST 2016:ERROR:groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script1
  • groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script1
  • at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
  • at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
  • at Script1.run(Script1.groovy:3)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  • at java.lang.Thread.run(Unknown Source)
  • Fri Jun 17 13:04:51 IST 2016:ERROR:groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script2
  • groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script2
  • at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
  • at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
  • at Script2.run(Script2.groovy:3)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  • at java.lang.Thread.run(Unknown Source)
  • Fri Jun 17 13:05:39 IST 2016:ERROR:groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script3
  • groovy.lang.MissingPropertyException: No such property: mockRequest for class: Script3
  • at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
  • at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
  • at Script3.run(Script3.groovy:5)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  • at java.lang.Thread.run(Unknown Source)
No RepliesBe the first to reply