Thanks for the response, Jon.
The LOGGER is not the only issue I’m seeing. It is a ton of injections that begin failing. The strange part is that system will operate fine, under load, for hours, days, etc., then all of a sudden, begin kicking out these errors. It is almost like the objects have been evicted from cache.
More to the point of your question, the LOGGER is injected into the variables scope (since it is used a LOT within a service), and thus does not have to (per my understanding) need to be scoped when called. Following is a segment of code that reflects specifically, an instance of the problem:
component
displayname=“model.sms.EngineService”
output=“false”
autowire=“true”
singleton=“true”
{
// Base Dependency injections
property name=“LOGGER” inject=“Logbox:logger:{this}” scope=“variables”;
// Engine sub-systems
property name=“ReportScanner” inject=“model:sms.ReportScanner” scope=“instance”;
property name=“InboxScanner” inject=“model:sms.InboxScanner” scope=“instance”;
property name=“QueueBuilder” inject=“model:sms.QueueBuilder” scope=“instance”;
property name=“DeviceSync” inject=“model:sms.DeviceSync” scope=“instance”;
property name=“Cleaner” inject=“model:sms.Cleaner” scope=“instance”;
public EngineService function init() {
return this;
}
public struct function process() {
var result = {};
// Retrieve requestContext collection
var rc = instance.controller.getRequestService().getContext().getCollection();
// ---------------------------------------------------
// Invoke the InboxScanner to process inbound messages
// ---------------------------------------------------
LOGGER.info(“Starting SMSEngine InboxScanner to processing incoming messages”);
try {
// Invoke InboxScanner process
var rsResult = instance.InboxScanner.process(rc.engineInfo);
// Add log entries and update stats
LOGGER.info(“SMSEngine InboxScanner completed. #rsResult.processedCount# inbound entries processed”);
SMSLog.addLogEntry(activityType = “Engine”, activityValue = “EngineStatus”,
argumentCollection = {
sessionId = rc.engineInfo.getSessionId(),
comment = “InboxScanner completed after processing #rsResult.processedCount# inbound entries”
});
// Update engine stats
rc.engineInfo.getStatistics().set( “reportsPublished”, rsResult.processedCount );
if( !rsResult.success ) {
rc.engineInfo.getStatistics().set( “errorFlag”, true );
}
} catch( Any e ) {
SMSLog.addLogEntry(activityType = “Engine”, activityValue = “EngineStatus”,
argumentCollection = {
sessionId = rc.engineInfo.getSessionId(),
comment = “InboxScanner returned error - #e.message#”,
errorInfo = serializeJSON(instance.UtilityService.trimErrorInfo(e, “model,handlers”))
});
LOGGER.info("SMSEngine InboxScanner returned error: #e.message# - #e.detail# " &
“(Session #rc.engineInfo.getSessionId()#”);
rc.engineInfo.getStatistics().set( “errorFlag”, true );
}
}
}
I’ve trimmed a lot of the code out, leaving the above only for demo purposes. 99% of the time, everything is fine, but when it goes wonky, it starts logging that all the sub-systems (injected) don’t exist, including the LOGGER.
Thanks for looking at this. I have checked for any circular dependency injection, and we don’t have any. Also, we are only using the simply dependency injection, not a custom wirebox configuration.
Cheers!
Kevin S. Anderson
Software Engineer
Intelligent Software Solutions Inc.