|
From: Tony F. <ton...@ya...> - 2003-03-14 15:45:21
|
My changes are ready to integrate for the ErrorCoded stuff - please advise on how you'd like to coordinate it. (My preference would be to allow me to integrate and I will do as Juergen did, giving a high level description of what I did with each of the classes.)
I am however, now getting an error in one of the tests I wrote but never integrated for the ResourceMessageBundle, and it is a result of the change Juergen made to the ResouceBundleMessageSource. Juergen's change was to return a null if a MissingResourceException is thrown rather than throwing the an exception so that you traverse to the parent to try to resolve the msg. HIS CHANGE APPEARS TO BE CORRECT. However it appears to have uncovered another problem.
When trying to resolve a message, I now get caught in an infininant loop. What I am seeing is the following:
I have 2 objects to deal with in the test I am running. The ResourceBundleMessageSource (call this RB) and the XMLWebApplicationContext. (AppCtx)
Upon startup, the AbstractApplicationContext.refresh() method gets called. Within it the ResourceBundleMessageSource bean is obtained from the factory. Then the following code is run:
if ((this.messageSource instanceof NestingMessageSource) && this.parent != null) {
( (NestingMessageSource) messageSource).setParent(this.messageSource);
}
Ultimately, what happens is that the we get a circular reference with, RB.parent = AppCtx, AppCtx.messageSource = RB. The resolver keeps going in a loop.
So I guess my first question is, what should the MessageSource's parent be, when it belongs to a Ctx? Should it be the Ctx itself, the Ctx parent, or the Ctx parent's MessageSource? (I haven't yet tested it, but I think it should be the Ctx parent's MessageSource).
|