Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse 2021-03RC1 Question/Problem(Upgrading to 2021-03)
Eclipse 2021-03RC1 Question/Problem [message #1838925] Tue, 09 March 2021 16:54 Go to next message
Emily Gouge is currently offline Emily GougeFriend
Messages: 7
Registered: May 2013
Junior Member
I have a internationalized Eclipse RCP app that I tried upgrading to Eclipse 2021-03RC1 target. On the upgrading, it no longer launches and produces this partial stack trace:

Caused by: java.lang.NullPointerException
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.eclipse.osgi.internal.loader.buddy.GlobalPolicy.loadResource(GlobalPolicy.java:66)
	at org.eclipse.osgi.internal.loader.buddy.PolicyHandler.doBuddyResourceLoading(PolicyHandler.java:171)
	at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:685)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.getResource(ModuleClassLoader.java:216)
	at java.base/java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1736)
	at org.eclipse.osgi.util.NLS.load(NLS.java:332)
	at org.eclipse.osgi.util.NLS.initializeMessages(NLS.java:152)
	at XXX.Messages.<clinit>(Messages.java:1538)


The plugin it failed to load has a global BuddyPolicy:
Eclipse-BuddyPolicy: global

The issues seems to occur when it is trying to load variants of the various translation files (for example en_US), which don't exist (we only have en).

I think I tracked down the issue to this function in the GlobalPolicy class:

@Override
public URL loadResource(String name) {
	return getExportingBundles(BundleLoader.getResourcePackageName(name)) //
			.stream().findFirst().map(b -> {
				return b.getResource(name);
			}).orElseGet(null);
}


This:

getExportingBundles(BundleLoader.getResourcePackageName(name)).stream().findFirst()

returns an optional that has no value. I think when it tries to execute "map" it is failing.

This was on RC1, so it might be something that's already been fixed or perhaps I need to change something on my side. Any thoughts would be appreciated.

Thanks,
Emily

Re: Eclipse 2021-03RC1 Question/Problem [message #1839148 is a reply to message #1838925] Mon, 15 March 2021 21:45 Go to previous messageGo to next message
Rhodan76 Mising name is currently offline Rhodan76 Mising nameFriend
Messages: 71
Registered: July 2009
Member
Maybe this has been caused by changes introduced for https://bugs.eclipse.org/bugs/show_bug.cgi?id=570394 in https://git.eclipse.org/c/equinox/rt.equinox.framework.git/diff/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java?id=bf36b48391737e1d37a4e0aca0f0b1f7832fc103 ?
Re: Eclipse 2021-03RC1 Question/Problem [message #1839179 is a reply to message #1839148] Tue, 16 March 2021 22:40 Go to previous messageGo to next message
Emily Gouge is currently offline Emily GougeFriend
Messages: 7
Registered: May 2013
Junior Member
Yup, thanks for passing this along. Look likes it been fixed too so I'll checkout the new build. Thanks!

Re: Eclipse 2021-03RC1 Question/Problem [message #1839440 is a reply to message #1839179] Sun, 21 March 2021 15:38 Go to previous message
Trae Bailey is currently offline Trae BaileyFriend
Messages: 3
Registered: March 2021
Junior Member
Looks like the problem made it into the 4.19 release.

I see a fix for bug 571990 in the git repo, but the problem occurs with my target platform pointing to the 2021-03 software site.
Previous Topic:Add Entry to Theme drop down menu
Next Topic:[Help] (SWT:5152): Gtk-WARNING ?
Goto Forum:
  


Current Time: Wed Dec 04 00:05:50 GMT 2024

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

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

Back to the top