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

Bug 312109

Summary: Starting application that requires main thread when it is not available throws meaningless exception
Product: [Eclipse Project] Equinox Reporter: Michal Tkacz <Michal.Tkacz>
Component: CompendiumAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: batxut, jeffmcaffer, tjwatson
Version: unspecifiedFlags: jeffmcaffer: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch none

Description Michal Tkacz CLA 2010-05-07 14:41:02 EDT
Build Identifier: 

In certain circumstances, e.g. when OSGi is run on top of servlet container with servletbridge, the main thread is not available. In that case starting an application that requires one (as defined using org.eclipse.core.runtime.applications extension point) throws following exception:


org.osgi.service.application.ApplicationException
    at org.eclipse.equinox.internal.app.EclipseAppContainer.launch(EclipseAppContainer.java:328)
    at org.eclipse.equinox.internal.app.EclipseAppDescriptor.launchSpecific(EclipseAppDescriptor.java:93)
    at org.osgi.service.application.ApplicationDescriptor.launch(ApplicationDescriptor.java:315)
    at org.eclipse.equinox.internal.app.AppCommands._startApp(AppCommands.java:183)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    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:636)

The idea is to add a message that would make clear the reason of the error.

Reproducible: Always
Comment 1 Thomas Watson CLA 2010-05-11 12:11:25 EDT
I consider this a bug, not an enhancement.  I will fix in next release since we are ramping down 3.6.
Comment 2 Thomas Watson CLA 2010-05-11 12:13:34 EDT
On second thought.  I will just fix this now to avoid more possible confusion.
Comment 3 Thomas Watson CLA 2010-05-11 12:23:32 EDT
Created attachment 167961 [details]
patch
Comment 4 Thomas Watson CLA 2010-05-11 12:24:02 EDT
Jeff, please review.
Comment 5 Thomas Watson CLA 2010-05-11 13:02:57 EDT
Patch released for RC1.