Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Exception Starting Unresolved Bundles
Exception Starting Unresolved Bundles [message #79988] Mon, 01 January 2007 14:24 Go to next message
Eclipse UserFriend
Originally posted by: jason.zutubi.com

Hi all,

As mentioned in a previous post, I am having some trouble when trying to
install and start bundles in 3.3M4. For example, if I install both
equinox.common and equinox.registry using BundleContext.installBundle,
then start them using Bundle.start(Bundle.START_TRANSIENT), I get an
exception:

org.osgi.framework.BundleException: State change in progress for bundle
" reference:file:C:\tools\cygwin\home\jsankey\repo\pulse\trunk \plugins\internal\org.eclipse.equinox.common_3.3.0.v20061117 -3.3M4.jar "
by thread "main".
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.begi nStateChange(AbstractBundle.java:1141)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:347)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1115)
at
org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re sumeBundles(PackageAdminImpl.java:255)
at
org.eclipse.osgi.framework.internal.core.PackageAdminImpl.do ResolveBundles(PackageAdminImpl.java:225)
at
org.eclipse.osgi.framework.internal.core.PackageAdminImpl.re solveBundles(PackageAdminImpl.java:173)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:301)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
at
com.zutubi.pulse.plugins.DefaultPluginManager.loadInternalPl ugins(DefaultPluginManager.java:91)
at
com.zutubi.pulse.plugins.DefaultPluginManager.init(DefaultPl uginManager.java:40)
....

Tracing the code, this feels like a bug. If a bundle is started when in
the INSTALLED state (i.e. not resolved), and a few other (seemingly
common) conditions are met, the above occurs. The bundle is already
undergoing state change by being started, but the resolve->resume
process tries to mark it for state change again. I can overcome this by
forcing the bundles to be resolved (in any of a few different ways)
before I start them.

I also poked into the EclipseStarter and ConfigurationActivator to try
and understand why they are unaffected. In both cases, they avoid the
issue by a call to PackageAdmin.refreshPackages in between installing
and starting bundles (so bundles are resolved before start is called).
In fact, the code in these two classes is pretty much cut-and-pasted
and, to quote a comment, "a hack". This arises as the refresh is
asynchronous but in these cases the code forces it to be synchronous by
waiting for FrameworkEvent.PACKAGES_REFRESHED. All this seems quite
complicated for what ought to be a basic use case: installing and
starting bundles. In my case I am currently just calling
PackageAdmin.resolveBundles, but do wonder when a package refresh is
necessary? My reading of the spec suggests that it is only important
when some bundles are uninstalled, which can happen in the configurator
case but not (as yet) in my own case.

Cheers,
Jason
Re: Exception Starting Unresolved Bundles [message #80264 is a reply to message #79988] Fri, 05 January 2007 19:17 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Jason,

This is indeed a bug. When I reproduce it I only see a FrameworkEvent
of type ERROR get posted and written to the log, but the bundle actually
starts successfully and the exception is not thrown to the caller of
Bundle.start. Is that what you are seeing?

I opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=169717 to
address the invalid FrameworkEvent.

Tom
Re: Exception Starting Unresolved Bundles [message #80307 is a reply to message #80264] Sat, 06 January 2007 23:59 Go to previous message
Eclipse UserFriend
Originally posted by: jason.zutubi.com

Tom Watson wrote:
> This is indeed a bug. When I reproduce it I only see a FrameworkEvent
> of type ERROR get posted and written to the log, but the bundle actually
> starts successfully and the exception is not thrown to the caller of
> Bundle.start. Is that what you are seeing?

Yes, you are right. I see the logged exception, but it is not propagated.

> I opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=169717 to
> address the invalid FrameworkEvent.

Thanks!

Jason
Previous Topic:Is the eclipse registry presistent?
Next Topic:Eclipse RCP Plugin with an RMIClassloader
Goto Forum:
  


Current Time: Fri Apr 26 09:40:43 GMT 2024

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

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

Back to the top