Community
Participate
Working Groups
Created attachment 278672 [details] .log in workspace after the startup crash When installing a Plugin in the Eclipse Modeling Edition 2019-03 (but possible also other editions), which has an immediate OSGI Service that either directly or indirectly uses the org.eclipse.core.resources.ResourcesPlugin, the Eclipse instance crashes at startup with message "An error occurred. See the log file <log-file-location>". In our case this happens because our service has a Reference to a service using EMF. As EMF seems to use the ResourcesPlugin, services using EMF cannot be used as immediate. Interestingly, the error does not occur during the restart after installing the plugin. But starting Eclipse afterwards, it occurs every time. I attached a minimal sample plugin and feature as well as the log file using this example. The example contains the immediate OSGI service Immediate which references a service of interface ServiceInterface. The interfaces implementation TestService creates an EObject on activate. The root exception seems to be the following (for the full stacktraces, see attached log file): Root exception: java.lang.IllegalStateException: The instance data location has not been specified yet. at org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized(DataArea.java:59) at org.eclipse.core.internal.runtime.DataArea.getStateLocation(DataArea.java:136) at org.eclipse.core.internal.runtime.InternalPlatform.getStateLocation(InternalPlatform.java:534) at org.eclipse.core.runtime.Plugin.getStateLocation(Plugin.java:308) at org.eclipse.core.internal.resources.LocalMetaArea.<init>(LocalMetaArea.java:63) at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:481) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:815) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:808) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:765) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1005) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:357) at org.eclipse.osgi.container.Module.doStart(Module.java:589) at org.eclipse.osgi.container.Module.start(Module.java:457) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:471) at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:331) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:39) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.eclipse.emf.ecore.plugin.EcorePlugin.getWorkspaceRoot(EcorePlugin.java:1149)
Created attachment 278673 [details] Minimal example plugin and feature as source projects
I would say that's the problem of resources plugin - if one uses it, one should always specify workspace (-data argument). It is kind of "was always there" precondition and AFAIK there is no way to use resources without it. Unlikely this will change, but if you have a good idea - you are welcome.
Okay, I thought it was weird because I explicitly selected a workspace in Eclipse's workspace selection dialog. However, it seems it's just initialized too late.
(In reply to Lucas Koehler from comment #3) > Okay, I thought it was weird because I explicitly selected a workspace in > Eclipse's workspace selection dialog. However, it seems it's just > initialized too late. This is too late, the problem is that immediate service is triggering resource plugin init *before* the UI (and selection dialog) starts.