When opening an editor in Eclipse, in a project that has a Spoofax nature, but no metaborg.yaml file, the following log messages are shown and an NPE is thrown:

14:51 | ERROR | .m.s.e.p.EclipseProjectService - Could not retrieve project configuration from project directory eclipse:///spoofax.runtime.pie
14:51 | ERROR | .m.s.e.p.EclipseProjectService - Could not retrieve project configuration from project directory eclipse:///spoofax.runtime.pie
14:51 | ERROR | .m.s.e.p.EclipseProjectService - Could not retrieve project configuration from project directory eclipse:///spoofax.runtime.pie
14:51 | ERROR | .m.s.e.p.EclipseProjectService - Could not retrieve project configuration from project directory eclipse:///spoofax.runtime.pie
14:51 | ERROR | o.m.s.e.e.EditorUpdateJob      - Failed to update editor for eclipse:///spoofax.runtime.pie/src/main/kotlin/mb/spoofax/runtime/pie/generated/spoofax.pie
java.lang.NullPointerException: null
	at org.metaborg.core.context.ProjectContextStrategy.get(ProjectContextStrategy.java:13) ~[org.metaborg.core_2.3.0.20170907-075043-master.jar:na]
	at org.metaborg.core.context.ContextService.get(ContextService.java:30) ~[org.metaborg.core_2.3.0.20170907-075043-master.jar:na]
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.update(EditorUpdateJob.java:285) ~[org.metaborg.spoofax.eclipse_2.3.0.20170907-075043-master.jar:na]
	at org.metaborg.spoofax.eclipse.editor.EditorUpdateJob.run(EditorUpdateJob.java:144) ~[org.metaborg.spoofax.eclipse_2.3.0.20170907-075043-master.jar:na]
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) [org.eclipse.core.jobs_3.9.0.v20170322-0013.jar:na]
14:51 | ERROR | .m.s.e.p.EclipseProjectService - Could not retrieve project configuration from project directory eclipse:///spoofax.runtime.pie
14:51 | ERROR | o.m.s.e.b.ProjectBuilder       - Cannot build project, cannot retrieve Metaborg project for P/spoofax.runtime.pie

Parsing and syntax styling of the editor seems to work, but analysis does not and triggers the NPE.

The expected behavior is that no errors are shown in the console, and that no NPE is thrown. Also, the expectation is that an Eclipse project with Spoofax nature but no metaborg.yaml file defaults to a project with compile dependencies on the latest version of all loaded language components.

Current workaround: add a valid metaborg.yaml file for the project.

Submitted by Gabriël Konat on 13 September 2017 at 14:53

On 13 September 2017 at 14:53 Gabriël Konat tagged eclipse

On 13 September 2017 at 14:54 Gabriël Konat tagged minor

Log in to post comments