Could not invoke Toolbar listener method: onSave - NPE on GridTab.fireDataStatusChanged
Description
Environment
Activity
Carlos Ruiz February 6, 2025 at 10:37 AM
OK, I’ll add a breakpoint at GridTab.fireDataStatusChanged:2385 and see if it stops there during any test
Hiep Lq February 6, 2025 at 6:15 AM
That error appears when I use the latest code, but I can't reproduce it. I only saw it in the console
Carlos Ruiz February 5, 2025 at 4:36 PM
did the error appear today? it could be the commit from yesterday reopened the issue
Hiep Lq February 5, 2025 at 4:30 PM
I suddenly saw this warning in the console
GridTab.fireDataStatusChanged: IDEMPIERE-2449 - event must not arrive null here -> [Ljava.lang.StackTraceElement;@b917a7a [210]
So I think the code
log.warning("IDEMPIERE-2449 - event must not arrive null here -> " + Thread.currentThread().getStackTrace());
should be changed to
log.log(Level.WARNING, "IDEMPIERE-2449 - event must not arrive null here -> ", new Exception());
Carlos Ruiz February 1, 2025 at 12:16 PM
Detected that last commit caused slowness opening windows.
Opening sales order window was taking like 3.5 seconds in my local eclipse, after reverting that commit it takes around 1.5 seconds
So, reverted and reopening this ticket.
Bringing suggestion from @Heng Sin Low in pull request:
There are other possible approach (like remove m_dataStatusEvent variable and use atomic fo m_last*) but will require larger scale changes and more testing.
Periodically and randomly I find this issue
14:40:27.145===========> ADWindowToolbar.doOnClick: Could not invoke Toolbar listener method: onSave() [74] java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor279.invoke(Unknown Source) ... at org.adempiere.webui.adwindow.ADWindowToolbar.doOnClick(ADWindowToolbar.java:413) caused by: java.lang.NullPointerException at org.compiere.model.GridTab.fireDataStatusChanged(GridTab.java:2354) at org.compiere.model.GridTab.dataStatusChanged(GridTab.java:2333) ...