Bug 507812 - NullPointerException in CharsetDeltaJob
Summary: NullPointerException in CharsetDeltaJob
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 10
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on: 501997
Blocks:
  Show dependency tree
 
Reported: 2016-11-19 15:05 EST by Roland Illig CLA
Modified: 2022-02-03 06:14 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Illig CLA 2016-11-19 15:05:35 EST
!ENTRY org.eclipse.core.jobs 4 2 2016-11-19 21:03:02.135
!MESSAGE An internal error occurred during: "Initializing workspace.".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.core.internal.resources.CharsetDeltaJob.startup(CharsetDeltaJob.java:210)
	at org.eclipse.core.internal.resources.CharsetManager.startup(CharsetManager.java:500)
	at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2404)
	at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2156)
	at org.eclipse.core.resources.ResourcesPlugin$1.run(ResourcesPlugin.java:521)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Andrey Loskutov CLA 2016-11-19 15:50:40 EST
Steps to reproduce? Which flavour of Eclipse is this, which version?
Comment 2 Andrey Loskutov CLA 2016-11-19 16:17:21 EST
Could it be that the Eclipse was installed and managed with Oomph, and that this error happened once and didn't occurred again? See bug 507092 comment 8.
Comment 3 Roland Illig CLA 2016-11-19 21:03:57 EST
(In reply to Andrey Loskutov from comment #1)
> Steps to reproduce? Which flavour of Eclipse is this, which version?

Version: Oxygen Release Milestone 3 (4.7.0 M3)
Build id: 20161103-0824
Installed plugins:
* GoClipse
* Lombok

Reproducing this is not simple. I _think_ it happened after a fresh installation of Eclipse 4.7.0 M3, when starting it for the first time.

(In reply to Andrey Loskutov from comment #2)
> Could it be that the Eclipse was installed and managed with Oomph, and that
> this error happened once and didn't occurred again? See bug 507092 comment 8.

No, I didn't install Eclipse with Oomph. I downloaded the full package directly from https://eclipse.org/downloads/index-developer.php.

This is probably not related to bug 507092, but I can reproduce that one.
Comment 4 Andrey Loskutov CLA 2016-11-20 11:27:52 EST
(In reply to Roland Illig from comment #3)
> This is probably not related to bug 507092, but I can reproduce that one.

So does it happen always for you? Any specific steps, or just start Eclipse? Can you see it with plain SDK? Is this related to a specific workspace?
Comment 5 Patrik Suzzi CLA 2016-11-28 15:29:56 EST
Hi, All !

Thanks for reporting and the updates. 

I see there is some open question, so I'm adding the needinfo keyword.

Note: I'm also lowering the severity based on the fact the bug is not reproducible. 

Please, correct me if I'm wrong.
Comment 6 Eclipse Genie CLA 2020-03-02 08:40:47 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Rauno Ots CLA 2021-06-07 09:07:12 EDT
I ca reproduce this with running the CDO example https://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples.master/ExampleMasterServer.launch
with Eclipse Modelling tools 2021-03 on Windows 10
Comment 8 Vaclav Haisman CLA 2022-01-17 08:24:22 EST
I can see this with 4.21 Equinox:

[INFO] org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
[INFO]  at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:828)
[INFO]  at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:759)
[INFO]  at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1019)
[INFO]  at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
[INFO]  at org.eclipse.osgi.container.Module.doStart(Module.java:605)
[INFO]  at org.eclipse.osgi.container.Module.start(Module.java:468)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.lambda$1(ModuleContainer.java:1834)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1829)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1777)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1739)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
[INFO]  at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
[INFO]  at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
[INFO]  at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:339)
[INFO] Caused by: java.lang.NullPointerException
[INFO]  at org.eclipse.core.internal.resources.CharsetDeltaJob.startup(CharsetDeltaJob.java:212)
[INFO]  at org.eclipse.core.internal.resources.CharsetManager.startup(CharsetManager.java:505)
[INFO]  at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2484)
[INFO]  at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2231)
[INFO]  at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:475)
[INFO]  at org.eclipse.osgi.internal.framework.BundleContextImpl.lambda$2(BundleContextImpl.java:808)
[INFO]  at java.base/java.security.AccessController.doPrivileged(Native Method)
[INFO]  at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:802)
[INFO]  ... 13 more
Comment 9 Jeremie Bresson CLA 2022-01-28 02:22:07 EST
I got the same error.

For me this looks like a startup order error.

The bundle `org.eclipse.core.resources` is activated before `org.eclipse.core.contenttype` is started.

Code: `Platform.getContentTypeManager()` which delegate to `InternalPlatform#getContentTypeManager()` which does only an OSGi service lookup to find an implementation of `IContentTypeManager`

See:

https://git.eclipse.org/c/platform/eclipse.platform.resources.git/tree/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/CharsetDeltaJob.java#n212

https://git.eclipse.org/c/platform/eclipse.platform.runtime.git/tree/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java#n705

https://git.eclipse.org/c/platform/eclipse.platform.runtime.git/tree/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java#n278

---

That said I have no idea how to debug this.

---

I also saw that the same issue (same stacktrace was reported in the "ecore-glsp" project):
https://github.com/eclipse-emfcloud/ecore-glsp/issues/114
Comment 10 Jeremie Bresson CLA 2022-02-03 06:14:15 EST
> The bundle `org.eclipse.core.resources` is activated before `org.eclipse.core.contenttype` is started.

Not really. Order was correct and can be traced with an approach described here:

https://www.vogella.com/tutorials/EclipsePerformance/article.html#example-tracing-the-startup-time-of-plug-ins

----

At the end it is still a bundle startup order:

`org.eclipse.core.contenttype` is probably using OSGi declarative service.
This require "org.apache.felix.scr" to be started early in the startup process.
(or "org.eclipse.equinox.ds" for older versions of equinox)


So I had to update my `*.product` file to add following line to the configuration section.

> <plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />


See the corresponding fix in the "ecore-glsp" project:
https://github.com/eclipse-emfcloud/ecore-glsp/pull/118#pullrequestreview-871505925

----

See also this blog post:

https://www.davidpace.de/replacing-org-eclipse-equinox-ds-with-org-apache-felix-scr-in-eclipse-product-builds/

Or this question on Stackoverflow:

https://stackoverflow.com/a/67959779