HI,
HELP needed with java.lang.NullPointerException ERROR,
I’m trying to run the code below (i have imported all the necessary packages) -
def slurper = new groovy.json.JsonSlurper()
def result = slurper.parseText('{"name":["itay","omer","shlomi","rotem"],"age":30}')
def client = new RESTClient( 'http://localhost:3000' )
writeToFile("JSON REQ1")
writeToFile(result)
def resp = client.post( path : '/testrtdm',
ContentType: JSON,
body: result,
and getting error without any explanation –
com.sas.analytics.ph.RTDMException: Failure running user groovy activity
at com.sas.analytics.crm.rtdm.activities.GroovyClassActivity.execute(GroovyClassActivity.java:279)
at com.sas.rtdm.implementation.EventExecutor.execute(EventExecutor.java:243)
at com.sas.rtdm.implementation.TestExecutor.execute(TestExecutor.java:209)
at com.sas.rtdm.implementation.engine.ActivityNode._execute(ActivityNode.java:58)
at com.sas.rtdm.implementation.engine.ActivityNode._execute(ActivityNode.java:18)
at com.sas.rtdm.implementation.engine.SchedulableNode$1.call(SchedulableNode.java:89)
at com.sas.rtdm.implementation.engine.SchedulableNode$1.call(SchedulableNode.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setBody(HTTPBuilder.java:1200)
at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setPropertiesFromMap(HTTPBuilder.java:1111)
at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.<init>(HTTPBuilder.java:946)
at groovyx.net.http.RESTClient.post(RESTClient.java:140)
at groovyx.net.http.RESTClient$post$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at MyActivity.run(script1548768272512393757402.groovy:54)
at com.sas.analytics.crm.rtdm.activities.GroovyClassActivity.execute(GroovyClassActivity.java:267)
... 10 more