Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 485378

Summary: [server] Server startup blows up if it cannot read the tasks folder
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 11.0   
Target Milestone: 11.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2016-01-07 16:33:00 EST
Tasks are persisted in ${OSGi}/.metadata/.plugins/org.eclipse.orion.server.core/tasks.

When the Orion server starts for the first time, it finds that the tasks folder does not exist and creates the folder. Later in the startup it tries to cleanup the folder.

When I make the org.eclipse.orion.server.core unreadable, the Orion server fails to report a problem creating the tasks folder. Then later in the startup there is a huge blowup type NullPointerException when it tries to process the tasks folder that does not exist.

Since the NullPointerException is in the core bundles startActivator, the entire server fails to start with a massive list of exceptions.

The meat of the exception at the bottom of the stack trace is: 

Caused by: java.lang.NullPointerException
	at org.eclipse.orion.internal.server.core.tasks.TaskStore.readAllTasks(TaskStore.java:200)
	at org.eclipse.orion.internal.server.core.tasks.TaskService.cleanUpTasks(TaskService.java:78)
	at org.eclipse.orion.internal.server.core.tasks.TaskService.<init>(TaskService.java:73)
	at org.eclipse.orion.internal.server.core.Activator.registerServices(Activator.java:184)
	at org.eclipse.orion.internal.server.core.Activator.start(Activator.java:166)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(AccessController.java:456)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	... 100 more
Comment 1 Anthony Hunter CLA 2016-01-07 17:04:15 EST
Added the appropriate checks and error/info messages in commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=d11c199ed2c49b5c4cc486c535fc24d981e0da52