queryJournal --> stack overflow

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)

That stack trace suggests that some of the object classes in the alarm journal are in classloaders that the webdev module can’t see (not surprising, the gateway isolates modules from each other), and the json encoder needs that information. You’ll have to iterate through the contents converting to global types, typically strings.

I have a better understanding now.
What I wonder is could have system.util.jsonEncode() made the following code better?

alarms = system.alarm.queryJournal(
   startDate='2017-04-12 07:00:00', 
   endDate='2017-04-12 08:00:00',
   includeData=False,
   includeSystem=False
)

columns = ['Id','isAckData','AckData']		
rows = []
for alarm in alarms:
	row = []
	row.append(alarm.getId())
	ack = alarm.isAcked()
	row.append(ack)
	if ack:
		row.append(str(alarm.getAckData()))
	rows.append(row)
	
result = {}
result['columns'] = columns
result['rows'] = rows
return {'json': result}