Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Eclipse 4 logging(Exception throws in startup in Activator)
Eclipse 4 logging [message #1805736] Tue, 23 April 2019 00:30 Go to next message
Janusz Dalecki is currently offline Janusz DaleckiFriend
Messages: 63
Registered: January 2010
Location: Sydney
Hi All,
I am trying to follow the tutorial "Eclipse Logging- Tutorial" by Lars Vogel and Simon Scholz - using Eclipse Photon, Java 1.8_0_121 windows 10. (
I would like to be able to use slf4j API for logging purpose.
I have a function (taken from the tutorial) called 'configureLogbackExternal':
private void configureLogbackExternal(Bundle bundle) throws JoranException, IOException {
	    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
	    JoranConfigurator jc = new JoranConfigurator();

	    // overriding the log directory property programmatically
//	    String logDirProperty = "";// ... get alternative log directory location
//	    context.putProperty("LOG_DIR", logDirProperty);

	    // get the configuration location where the logback.xml is located
	    Location configurationLocation = Platform.getInstallLocation();
	    File logbackFile = new File(configurationLocation.getURL().getPath(), "logback.xml");
	    if(logbackFile.exists()) {
	    } else {
	        URL logbackConfigFileUrl = FileLocator.find(bundle, new Path("logback.xml"), null);

When the method 'Platform.getInstallLocation()' is called I get an exception:
Root exception:
org.eclipse.core.runtime.AssertionFailedException: assertion failed: The application has not been initialized.
	at org.eclipse.core.runtime.Assert.isTrue(
	at org.eclipse.core.internal.runtime.InternalPlatform.assertInitialized(
	at org.eclipse.core.internal.runtime.InternalPlatform.getInstallLocation(
	at org.eclipse.core.runtime.Platform.getInstallLocation(
	at config.Activator.configureLogbackExternal(
	at config.Activator.start(

Could somebody help me with this I don't know why the exception is generated.

Kind Regards,
Re: Eclipse 4 logging [message #1805807 is a reply to message #1805736] Wed, 24 April 2019 13:40 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

The platform maintains several "locations". It seems your bundle is being started before the primary Eclipse Platform bundle (org.eclipse.core.runtime) has been started: your bundle likely has a start-level that's less than that set for org.eclipse.core.runtime, so it's being started before org.eclipse.core.runtime. Change your start-level to be higher than the core.runtime.
Previous Topic:[RESOLVED] Core expression checking for project natures not working
Next Topic:AddOn does not execute
Goto Forum:

Current Time: Fri Apr 16 15:31:42 GMT 2021

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

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

Back to the top