Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347967 - Logging throws an NPE in the EntryPoint before creating the WorkbenchAdvisor
Summary: Logging throws an NPE in the EntryPoint before creating the WorkbenchAdvisor
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-01 11:50 EDT by Serge Démoulin CLA
Modified: 2011-06-03 02:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Démoulin CLA 2011-06-01 11:50:02 EDT
Build Identifier: 

The call of org.eclipse.core.runtime.Plugin.getBundle().log(IStatus) produce an NPE when called before the creation of the WorkbenchAdvisor.
The cause is that org.eclipse.ui.internal.Workbench.getInstance().getAdvisor().getWorkbenchErrorHandler().handle() is indirectly called and Workbench.getInstance() returns null (see stacktrace under). Precision : at the start of the OSGi platform the logging was possible without NPE from the start() methods of the plugins.

In my case the workaround is to create the WorkbenchAdvisor first.

STACK TRACE
java.lang.NullPointerException
	at org.eclipse.ui.internal.WorkbenchErrorHandlerProxy.handle(WorkbenchErrorHandlerProxy.java:35)
	at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:189)
	at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231)
	at org.eclipse.ui.statushandlers.StatusManager$StatusManagerLogListener.logging(StatusManager.java:305)
	at org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:160)
	at org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:100)
	at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:84)
	at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:165)
	at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:146)
	at org.eclipse.equinox.log.internal.ExtendedLogServiceFactory.log(ExtendedLogServiceFactory.java:65)
	at org.eclipse.equinox.log.internal.ExtendedLogServiceImpl.log(ExtendedLogServiceImpl.java:87)
	at org.eclipse.equinox.log.internal.LoggerImpl.log(LoggerImpl.java:54)
	at org.eclipse.core.internal.runtime.Log.log(Log.java:60)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:32)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:24)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:63)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:50)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:42)
	at de.markant.infrastructure.util.log.InfrastructureLogUtil.log(InfrastructureLogUtil.java:73)
	at de.markant.zas.web.erfassung.ui.application.ZasWebErfassungEntryPoint.createUI(ZasWebErfassungEntryPoint.java:59)
	at de.markant.zas.web.erfassung.ui.application.ZasWebErfassungEntryPoint.createUI(ZasWebErfassungEntryPoint.java:120)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:73)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:211)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:88)
	at java.lang.Thread.run(Thread.java:595)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)

Reproducible: Always

Steps to Reproduce:
Call 'org.eclipse.core.runtime.Plugin.getBundle().log(IStatus)' as first instruction in the methods createUI() of the EntryPoint. #
I didn't try with an Application.
Comment 1 Serge Démoulin CLA 2011-06-01 11:51:51 EDT
The RAP Version was the 1.4.0-RC2