Thank you Wei, Jacques for your reply. What I was proposing to change method of WidgetWorker.getDelegator() method. I see whenever any form render the fields and requires delegator then it always tries to get delegator from WidgetWorker's mentioned method. Please refer MacroFormRenederer class as mentioned in the OFBIZ-9230 by Jacques.
If we fix that method, then I think we should be fine and while rendering system will always have the delegator and this issue should not appear. In that case we won't required extra delegaor checks in the EntityUtilProperties class for this particular issue. In case we requied this check from other place then we need to make sure delegator always passed to EntityUtilProperties methods, instead of adding condition in the EntityUtilProperties methods. Because many methods in that class uses the delegator as parameter. Finally we should catch the GenericEntityException instead of Exception. In a way #1 and #3 needs to be work on and for #2 we should let it be as is so that in future system will report if somewhere we are losing the delegator then we could take care. That means what Jacques did in his last fix should be fine, simply log delegator is missing on console. This is what I'm proposing, but I'm okay if we want to fix delegator issue in the EntityUtilProperties class, if so then I would say to fix it for all methods which uses delegator as parameter. Thanks! Rishi Solanki Sr. Manager, Enterprise Software Development HotWax Systems Pvt. Ltd. Direct: +91-9893287847 http://www.hotwaxsystems.com On Thu, Mar 2, 2017 at 8:02 AM, Wei Zhang <zhangwei1...@outlook.com> wrote: > I think we need to do 3 things. > > 1. Catch GenericEntityException in > EntityUtilProperties.getSystemPropertyValue() > 2. Create a new Delegator if it is null in > EntityUtilProperties.getSystemPropertyValue() > 3. Find out how to get a delegator instance in > framework/widget/templates/HtmlFormMacroLibrary.ftl > > > > > ----- > 程序羊 > -- > View this message in context: http://ofbiz.135035.n4.nabble. > com/Should-not-catch-Exception-in-EntityUtilProperties- > getSystemPropertyValue-tp4702833p4702909.html > Sent from the OFBiz - Dev mailing list archive at Nabble.com. >