When I call queryJournal using the script below, I get a stack overflow.
As suggested, I tried including a journal name. But, there is only one MSSQL attached. And I tried journalName=“SQLServer_SQLAuth” which is the name on the status page, and journalName=IgnitionAlarms" which was found on the connection configuration page in the field named “Extra Connection Properties” with the value of “databaseName=IgnitionAlarms”. But, neither work.
What else could I do?
Python script used:
logger = system.util.getLogger("webdevGet")
logger.info(': )')
alarms = system.alarm.queryJournal(
startDate='2017-04-12 07:00:00',
endDate='2017-04-12 08:00:00',
includeData=False,
includeSystem=False
)
l = len(alarms)
logger.info('length: ' + str(l))
logger.info('alarms[0]: ' + str(alarms[0]))
result = {}
columns = ['Id','AckData']
rows = []
for alarm in alarms:
row = []
row.append(alarm.getId())
ack = alarm.isAcked()
if ack:
row.append(alarm.getAckData())
rows.append(row)
result['columns'] = columns
result['rows'] = rows
return {'json': result}
When the script is executed, I get this stack trace
java.lang.StackOverflowError: null
at java.lang.Class.getPackage(Unknown Source)
at org.json.JSONObject.wrap(JSONObject.java:1599)
at org.json.JSONObject.populateMap(JSONObject.java:967)
at org.json.JSONObject.(JSONObject.java:272)
at org.json.JSONObject.wrap(JSONObject.java:1606)
at org.json.JSONObject.populateMap(JSONObject.java:967)
at org.json.JSONObject.(JSONObject.java:272)
at org.json.JSONObject.wrap(JSONObject.java:1606)