cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Error - Unable To Convert From org.mozilla.javascript.Undefined to LOCATION

Sathishkumar_C
17-Peridot

Error - Unable To Convert From org.mozilla.javascript.Undefined to LOCATION

var info = me.SampleData

var params = {

infoTableName : "InfoTable",

dataShapeName : "En.LineMapInput"

};

// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(En.PolyLineMapInput)

var data = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

var newEntry = new Object();

var ssLoc = me.Location

var locNE = NEB

var locNW = NWB

var locSE = SEB

var locSW = SWB

// distanceBetween(loc1:LOCATION,loc2:LOCATION,units:STRING):NUMBER

var diffNE = distanceBetween(ssLoc, locNE, "K");

var diffNW = distanceBetween(ssLoc, locNW, "K");

var diffSE = distanceBetween(ssLoc, locSE, "K");

var diffSW = distanceBetween(ssLoc, locSW, "K");

if(diffNE < 12 && diffNW < 12 && diffSE < 12 && diffSW < 12)

{

//    info.getRowCount()

    for(var i = 0; i < info.getRowCount(); i++)

    {

        newEntry.description = info.rows.description; // STRING

        newEntry.refid = info.rows.refid; // NUMBER - isPrimaryKey = true

        newEntry.id = info.rows.id; // STRING

        newEntry.point = info.rows.point; // LOCATION

        data.AddRow(newEntry);

    }

    result = data

}

else

{

    newEntry.description = info.rows[0].description; // STRING

    newEntry.refid = info.rows[0].refid; // NUMBER - isPrimaryKey = true

    newEntry.id = info.rows[0].id; // STRING

    newEntry.point = info.rows[0].point; // LOCATION

    data.AddRow(newEntry);

  

    result = data

}

}res

}

Hi all I have created a service like mentioned above.. When i loading a mashup i am getting an error like "Wrapped java.lang.Exception: Unable To Convert From org.mozilla.javascript.Undefined to LOCATION" on Application log.

*Note : NEB,NWB,SEB,SWB are inputs (Location basetype)

How can i resolve this issue?

Thanks & Regards,

Sathishkumar C.

1 REPLY 1

Hi Sathishkumar, do you know at specifically which point this error is thrown? Can you add logging to both of the calls data.AddRow(newEntry);


Additionally, I would also recommend, since you are creating custom services it'd be easier to debug, to have stack tracing enabled from the ThingWorx > Subsystem > Logging subsystem

Once this is enabled, reproduce this issue and this should add more info to the Error.log. May be you can also share the applicationlog and the error log here.

Top Tags