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

Bug 371103

Summary: java.util.MissingResourceException since juno M5 using -registryMultiLanguage argument
Product: [Eclipse Project] Equinox Reporter: Arnaud MERGEY <a_mergey>
Component: ComponentsAssignee: equinox.components-inbox <equinox.components-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan, john.arthorne, tjwatson
Version: unspecifiedFlags: john.arthorne: review+
Target Milestone: Juno M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 370724    
Attachments:
Description Flags
RCP application allowing to reproduce this issue
none
possible fix none

Description Arnaud MERGEY CLA 2012-02-09 11:21:59 EST
This issue has been discovered with a RAP application, but it occurs in RCP as well, so it seems to be an equinox bug.
Starting equinox with -registryMultiLanguage does not work anymore since Juno M5 there is exception given above (it worked before M5).

I will attached an application allowing to reproduce this issue, but it seems it occurs with any application.
In my case adding -registryMultiLanguage always trigger the exception (in every RAP and RCP application).

As a workaround, it is possible to add for example "Bundle-Localization: plugin" Header in Manifest and add an empty plugin.properties

java.util.MissingResourceException: Resource bundle not found for locale: fr
at org.eclipse.core.internal.runtime.Activator.getLocalization(Activator.java:243)
at org.eclipse.core.internal.runtime.ResourceTranslator.getResourceBundle(ResourceTranslator.java:69)
at org.eclipse.core.internal.runtime.ResourceTranslator.getResourceString(ResourceTranslator.java:76)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.translate(RegistryStrategyOSGI.java:106)
at org.eclipse.core.internal.registry.ExtensionRegistry.translate(ExtensionRegistry.java:1379)
at org.eclipse.core.internal.registry.ConfigurationElementMulti.getTranslatedAtIndex(ConfigurationElementMulti.java:64)
at org.eclipse.core.internal.registry.ConfigurationElementMulti.getAttribute(ConfigurationElementMulti.java:47)
at org.eclipse.core.internal.registry.ConfigurationElementMulti.getAttribute(ConfigurationElementMulti.java:111)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.getAttribute(ConfigurationElementHandle.java:34)
at org.eclipse.equinox.http.registry.internal.ServletManager.added(ServletManager.java:112)
at org.eclipse.equinox.http.registry.internal.ExtensionPointTracker.open(ExtensionPointTracker.java:75)
at org.eclipse.equinox.http.registry.internal.ServletManager.start(ServletManager.java:62)
at org.eclipse.equinox.http.registry.internal.HttpRegistryManager.start(HttpRegistryManager.java:106)
at org.eclipse.equinox.http.registry.internal.HttpServiceTracker.addingService(HttpServiceTracker.java:58)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:990)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:262)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:234)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:951)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.init(HttpServerManager.java:300)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:473)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:293)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:776)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:258)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:263)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:113)
at org.eclipse.equinox.http.jetty.internal.Activator.start(Activator.java:62)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1177)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Comment 1 Arnaud MERGEY CLA 2012-02-09 11:47:18 EST
Created attachment 210811 [details]
RCP application allowing to reproduce this issue

There is a Runner configuration (for RAP and RCP), you should see the issue trying to launch both with Juno M5
Comment 2 Thomas Watson CLA 2012-02-09 13:05:03 EST
This caused by the fix in bug369200.
Comment 3 Thomas Watson CLA 2012-02-09 14:01:58 EST
Created attachment 210817 [details]
possible fix

A possible fix.  John, could you review?
Comment 4 John Arthorne CLA 2012-02-09 14:30:55 EST
Looks good to me. I would say we don't need to log this at all. If the translated resource is not found it will fall back to the default string which is a common case (for example using a babel language pack that is old or incomplete). I think this would create a ton of log spam in some cases.
Comment 5 Thomas Watson CLA 2012-02-09 14:54:40 EST
Thanks John, I released the fix without the TODO.

http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=5a0096c1c2ca124f8ceb4f8702a5bdeea8d79f11