Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Won't Fix
-
2.22.14, 2.24.00
-
None
-
None
Description
When logging for org.apache.wicket is leveled to 'WARN', we see warning logs continuously like the following whenever any action occurs in cms frontend (tabbed panel rendered):
04.08.2011 12:56:51 WARN [org.apache.wicket.Localizer.getStringIgnoreSettings():198] Tried to retrieve a localized string for a component that has not yet been added to the page. This can sometimes lead to an invalid or no localized resource returned. Make sure you are not calling Component#getString() inside your Component's constructor. Offending component: [MarkupContainer [Component id = panel]]
I've just tried to find where this happens with debugging point in org.apache.wicket.Localizer#getStringIgnoreSettings(), which is invoked every time you use StringResourceModel() or some other localized string helper classes.
The method, org.apache.wicket.Localizer#getStringIgnoreSettings(), however, should not be invoked in a constructor as the warning log message mentions:
"Make sure you are not calling Component#getString() inside your Component's constructor. Offending component: [MarkupContainer [Component id = panel]]"
In org.hippoecm.frontend.plugins.standards.tabs.TabbedPanel, the constructor invokes #getTitleMarkupContainer() method, and the method tries to find "title" localized string for a link.
However, the "title" localized string is being tried to be resolved before its component is added to the page yet by being invoked in the container's constructor indirectly.
I have no solution for this, but it doesn't seem good to have this warning logs continuously, which fills the log files by itself!
So, could someone find a solution by not using StringResourceModel#getString() / Localizer#getStringIgnoreSettings() whether direct or indirect ?
Thanks in advance,
Woonsan
P.S. We may consider to level up the log level of Localizer to ERROR, but it is not graceful and cannot be a real solution.