Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312109 - Starting application that requires main thread when it is not available throws meaningless exception
Summary: Starting application that requires main thread when it is not available throw...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 14:41 EDT by Michal Tkacz CLA
Modified: 2010-05-11 13:02 EDT (History)
3 users (show)

See Also:
jeffmcaffer: review+


Attachments
patch (3.66 KB, patch)
2010-05-11 12:23 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.