Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Receiving Error message: "org.mozilla.javascript.JavaScriptException: java.lang.NullPointerException" while using Run script in Workflow

psjajda
Tera Expert

Hi,

We have requirement to update database table fields based on catalog item input variables. I created Run script in workflow of cat item, as below :

var acc = "ABC~"+current.<variable_Name>;
var gr = new JDBCProbe("midserver_name");
gr.setDataSource("<Datasource sysID>");
gr.setFunction("UPDATE");
gr.setTable("<TableName>");
gr.setWhereClause(<wherecondition>);
gr.addField("field0 ", "A");
gr.addField("field1","updatetime");
gr.create();

During execution of it, I am receiving an error as:

Run Script(sysID of script): org.mozilla.javascript.WrappedException: Wrapped org.mozilla.javascript.JavaScriptException: java.lang.NullPointerException (<refname>; line 17)

Let me know if anyone has faced similar issue and how to fix it.

Pankaj

 

3 REPLIES 3

JerryJ071847183
Tera Sage

Below blog regarding JDBC probe will be useful plz check

https://community.servicenow.com/community?id=community_question&sys_id=a02c0365db9cdbc01dcaf3231f96...

 

Mark my ANSWER as CORRECT and HELPFUL if it helps

Ashutosh Munot1
Kilo Patron

HI,

Which is line 17 in your code? Are you sure you are passing value in that line. It seems that variables value is null.

Thakns,
Ashutosh

Priyadharsini
Kilo Contributor

Hi psjajda,

Were you able to find solution for this issue. We are facing exactly same issue while sending SMS notification. Line#17 error. which is totally unknown.