Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » DynamicImport-Package fails
DynamicImport-Package fails [message #121326] Thu, 20 November 2008 00:43 Go to next message
Prashant Deva is currently offline Prashant Deva
Messages: 32
Registered: July 2009
Member
I am trying to instrument eclipse classes during runtime using a
ClassLoadingHook.
In the hook, for each bundle's manifest I am setting the property
dynamicimport-package : '*'
however despite this, i am getting a classnotfoundexception.

The technique I am trying to implement the class loading hook is very
similar to the one mentioned here -
http://www.eclemma.org/research/instrumentingosgi/index.html

After a lot of debugging I have traced the error to the following line of
code in org.eclipse.osgi.internal.resolver.StateImpl in the method
linkDynamicImport() -

BundleDescriptionImpl importer = (BundleDescriptionImpl) importingBundle;
if (importer.getDynamicStamp(requestedPackage) == getTimeStamp())
return null;

As it turns out this check passes and the null is returned, thus making my
class fail to load.
What here does dynamicStamp() and TimeStamp() stand for and why do they
fail?

Prashant
Re: DynamicImport-Package fails [message #1219604 is a reply to message #121326] Wed, 04 December 2013 16:04 Go to previous messageGo to next message
Aron L is currently offline Aron L
Messages: 3
Registered: December 2013
Junior Member
I have come across this same issue.

Prashant, did you ever figure out a solution?
Re: DynamicImport-Package fails [message #1220244 is a reply to message #1219604] Tue, 10 December 2013 10:08 Go to previous message
Thomas Watson is currently offline Thomas Watson
Messages: 419
Registered: July 2009
Senior Member
The dynamicStamp() and TimeStamp() are used to cache results which allow the resolver to return quickly if "nothing has changed" since the last time an attempt was done to resolve a dynamic import package. One pretty hackish workaround would be to install a dummy bundle and keep updating it each time you change the dynamic import policy of a bundle from your class loading hook. This would force the state timestamp to change which then would invalidate the dyanamic import cache.

For the current release being developed (luna) I think this issue should be fixed. But keep in mind the equinox specific hooks have been significantly redone which will require anyone implementing equinox specific hooks to migrate to the new hooks in luna.

Tom.
Previous Topic:Target Platform Jar Inter-dependencies
Next Topic:static fields at LocationManager
Goto Forum:
  


Current Time: Tue Jul 22 13:44:30 EDT 2014

Powered by FUDForum. Page generated in 0.01898 seconds