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

Ct111
Giga 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
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.