Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » NullpointerException in Workbench
NullpointerException in Workbench [message #1782435] Fri, 23 February 2018 13:30
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
I noticed a backround NPE in our application, I did not understand.

I managed to reproduce it with a simple application
(Just launch it and click the button, you will see the NPE in console)

It occurs when runnable used with jface progressmonitor dialog do something that fire an event in equinox registry.
In ProgressInfoItem 186, Display.getCurrent return null.
If I execute the same code inside an Eclipse Job, the NPE does not occurs, Display.getCurrent return the display, not null.

I do not understand yet, why it behaves differently between Job and ProgressDialog.

Anyway, according to comment above (and bug 341816) it seems here Display.getDefault could be used instead, unless I missed something and do something illegal in the code.

The exception:

java.lang.NullPointerException
at org.eclipse.ui.internal.progress.ProgressInfoItem.init(ProgressInfoItem.java:186)
at org.eclipse.ui.internal.progress.ProgressManager$ProgressManagerProvider.getInstance(ProgressManager.java:105)
at org.eclipse.ui.internal.progress.ProgressManager.getInstance(ProgressManager.java:187)
at org.eclipse.rap.ui.internal.progress.JobManagerAdapter$3.run(JobManagerAdapter.java:189)
at org.eclipse.rap.rwt.internal.lifecycle.ContextUtil.runNonUIThreadWithFakeContext(ContextUtil.java:67)
at org.eclipse.rap.rwt.internal.service.UISessionImpl.exec(UISessionImpl.java:246)
at org.eclipse.rap.ui.internal.progress.JobManagerAdapter.findSessionProgressManager(JobManagerAdapter.java:187)
at org.eclipse.rap.ui.internal.progress.JobManagerAdapter.findProgressManager(JobManagerAdapter.java:175)
at org.eclipse.rap.ui.internal.progress.JobManagerAdapter.scheduled(JobManagerAdapter.java:161)
at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:70)
at org.eclipse.core.internal.jobs.JobListeners.scheduled(JobListeners.java:125)
at org.eclipse.core.internal.jobs.JobManager.schedule(JobManager.java:1257)
at org.eclipse.core.internal.jobs.InternalJob.schedule(InternalJob.java:382)
at org.eclipse.core.runtime.jobs.Job.schedule(Job.java:635)
at org.eclipse.core.internal.registry.osgi.EquinoxRegistryStrategy.scheduleChangeEvent(EquinoxRegistryStrategy.java:86)
at org.eclipse.core.internal.registry.ExtensionRegistry.fireRegistryChangeEvent(ExtensionRegistry.java:278)
at org.eclipse.core.internal.registry.ExtensionRegistry.add(ExtensionRegistry.java:129)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1085)
at org.eclipse.core.internal.registry.ExtensionRegistry.addContribution(ExtensionRegistry.java:1040)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.addBundle(EclipseBundleListener.java:181)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.bundleChanged(EclipseBundleListener.java:79)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:719)
at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:511)
at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:457)
at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:447)
at org.eclipse.osgi.container.Module.start(Module.java:427)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)

Previous Topic:EclipseRAP Babel project
Next Topic:Nebula GridItem.setForeground not working
Goto Forum:
  


Current Time: Fri Jun 22 09:47:45 GMT 2018

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

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

Back to the top