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

Bug 299889

Summary: Exception when stopping cheatsheet bundle.
Product: [RT] RAP Reporter: Paul Kendall <pkendall64>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Paul Kendall CLA 2010-01-17 20:37:10 EST
Whenever we stop the cheatsheet bundle from the osgi console we get the stacktraces shown below.


osgi> f cheat
Id   State      Binding    Bundle                                                  Version              Detail
81   ACTIVE     COMPLETE   org.eclipse.rap.ui.cheatsheets                          1.3.0.20091214-1156  


osgi> stop 81
org.osgi.framework.BundleException: Exception in org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop() of bundle org.eclipse.rap.ui.cheatsheets.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:863)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ExceptionInInitializerError
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	... 13 more
Caused by: java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	... 17 more
Nested Exception:
java.lang.ExceptionInInitializerError
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	... 17 more
Nested Exception:
java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Nested Exception:
java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Nested Exception:
java.lang.ExceptionInInitializerError
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	... 17 more
Nested Exception:
java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Nested Exception:
java.lang.IllegalStateException: No context available outside of the request service lifecycle.
	at org.eclipse.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:108)
	at org.eclipse.rwt.internal.service.ContextProvider.getSession(ContextProvider.java:146)
	at org.eclipse.rwt.RWT.getLocale(RWT.java:275)
	at org.eclipse.rwt.RWT$NLS.getISO8859_1Encoded(RWT.java:99)
	at org.eclipse.ui.internal.cheatsheets.Messages.get(Messages.java:167)
	at org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader.<clinit>(CheatSheetRegistryReader.java:146)
	at org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin.stop(CheatSheetPlugin.java:401)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:484)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:445)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop(AbstractBundle.java:437)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._stop(FrameworkCommandProvider.java:280)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:157)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:142)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:106)
	at java.lang.Thread.run(Thread.java:619)
Comment 1 RĂ¼diger Herrmann CLA 2010-01-20 11:35:46 EST
Created attachment 156666 [details]
Fix

A constant from the CheatSheetRegistryReader class was initialized with a localized text. The RAP NLS mechanism needs the request scope to be present.
While stopping the bundle, this class is being accessed and - if not accessed before- initialized. This could lead to the attempt to use the NLS mechanism outside of the request scope.
The fix was to remove the constant and do without a translation.
Comment 2 RĂ¼diger Herrmann CLA 2010-01-20 11:40:29 EST
Applied patch to CVS HEAD