Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Occasional NullPointerException on TableEditor(Occasional NullPointerException on TableEditor)
Occasional NullPointerException on TableEditor [message #1742913] Thu, 08 September 2016 14:33 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi all,

I use TableViewer in my standalone RWT application. The table contains paginated data with TableEditor, however when navigating pages, I occassionally encounter NullPointerException pointing to the TableEditor. Below is the stacktrace:

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:3708)
at org.eclipse.swt.SWT.error(SWT.java:3631)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:199)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1201)
at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
at org.eclipse.rap.rwt.internal.lifecycle.ProcessAction.execute(ProcessAction.java:29)
at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:38)
at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:46)
at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.executeLifeCycle(RWTMessageHandler.java:57)
at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.handleMessage(RWTMessageHandler.java:41)
at org.eclipse.rap.rwt.internal.remote.MessageChainElement.handleMessage(MessageChainElement.java:29)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processMessage(LifeCycleServiceHandler.java:128)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processUIRequest(LifeCycleServiceHandler.java:100)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:75)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:66)
at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:135)
at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:117)
at org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3679)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1686)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1646)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: java.lang.NullPointerException
at org.eclipse.swt.custom.TableEditor.computeBounds(TableEditor.java:118)
at org.eclipse.swt.custom.ControlEditor.layout(ControlEditor.java:230)
at org.eclipse.swt.custom.TableEditor.layout(TableEditor.java:268)
at org.eclipse.swt.custom.TableEditor$2.run(TableEditor.java:108)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:38)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:193)
... 42 more

I use a TableEditor because I want to draw a button in one of the column. Actually I want to draw an Hyperlink but it does not seem to possible, but that's another topic.

Attached is my implementation of ColumnLabelProvider where I use TableEditor.

I use RAP 3.1.0.

Any help would be greatly appreciated.

Thanks & Regards,

Setya
Re: Occasional NullPointerException on TableEditor [message #1742921 is a reply to message #1742913] Thu, 08 September 2016 15:13 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 117
Registered: February 2013
Senior Member
may be say stupid
try add not Control but Composite
and after add Button into this Composite
Re: Occasional NullPointerException on TableEditor [message #1742987 is a reply to message #1742921] Fri, 09 September 2016 07:06 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
that's strange:
-------
Caused by: java.lang.NullPointerException
at org.eclipse.swt.custom.TableEditor.computeBounds(TableEditor.java:118)
at org.eclipse.swt.custom.ControlEditor.layout(ControlEditor.java:230)
at org.eclipse.swt.custom.TableEditor.layout(TableEditor.java:268)
at org.eclipse.swt.custom.TableEditor$2.run(TableEditor.java:108)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:38)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:193)
-------
at line 118 we have only item.getImageBounds(column), but the method TableEditor.computeBounds has a check for null and disposed item. Did you modify the RAP sources? Can you figure out what is null?
Regards,
Ivan
Re: Occasional NullPointerException on TableEditor [message #1743436 is a reply to message #1742987] Thu, 15 September 2016 12:48 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi Ivan,

No, I did not modify the source code.
From my observation it seems that we have race condition here. When item is check for null at initial method it's still OK, then along the way dispose was called, and item became null.

I think it's caused by our code:

for (TableEditor tableEditor : TABLE_EDITORS)
{
   if (tableEditor.getEditor() != null)
      tableEditor.getEditor().dispose();
                                        
  tableEditor.dispose();
}


After I remove 'tableEditor.dispose', the error is gone.

Is it enough just calling tableEditor.getEditor().dispose() like above ?

Thanks & Regards,
Setya
Previous Topic:Read HTTP Post Parameter
Next Topic:HTTPSession, multiple browser tabs/windows and "Page reload"
Goto Forum:
  


Current Time: Wed Aug 15 07:11:37 GMT 2018

Powered by FUDForum. Page generated in 0.02000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top