Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Is my p2.inf usage correct?(Trying to define a start level without apparent success.)
Is my p2.inf usage correct? [message #1066696] Wed, 03 July 2013 15:29
Gerald Rosenberg is currently offline Gerald Rosenberg
Messages: 104
Registered: July 2009
Senior Member
I am using Eclipse 4.3 and ObjectWeb ASM in a plugin to add some low level instrumentation to "org.eclipse.swt.widgets.Display". The plugin is not specific to an RCP application - primary use is intended with the standard Eclipse IDE workbench.

When launching the Eclipse workbench as an Eclipse application, the plugin works correctly, but when loaded into the workbench as a p2 installed plugin, the WeavingHook method is called after the Display.class is loaded.

I have put the following p2.inf in the META-INF directory of my weaving plugin. Unfortunately, it is not being recognized or is in someway not correct/sufficient to change the start level -- the WeavingHook is still called too late.

If I mark the plugin to be "unpacked" after the p2 install, the WeavingHook is *usually* called just in time to process Display.class. (So, the p2.inf is not working to load the plugin at start level 1, but instead the plugin is in a class loader race condition in the default start level 4?)

#create a requirement on the fragment we are creating  
requires.0.namespace=org.eclipse.equinox.p2.iu  
requires.0.name=configure.net.certiv.bent.core
requires.0.greedy=true  
      
#create a IU fragment named configure.net.certiv.bent.core
units.0.id=configure.net.certiv.bent.core  
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=configure.net.certiv.bent.core
units.0.instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bundle:${artifact});  
units.0.instructions.uninstall=org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bundle:${artifact});  
units.0.instructions.unconfigure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:-1); org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:false);  
units.0.instructions.configure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:1);org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true);

# add multiple sets of host requirements to ensure this p2.inf is selected
units.0.hostRequirements.1.namespace=osgi.bundle
units.0.hostRequirements.1.name=net.certiv.bent.core
units.0.hostRequirements.1.greedy=false

units.0.hostRequirements.2.namespace=org.eclipse.equinox.p2.eclipse.type
units.0.hostRequirements.2.name=bundle
units.0.hostRequirements.2.range=[1.0.0,2.0.0)
units.0.hostRequirements.2.greedy=false

units.0.requires.1.namespace=osgi.bundle
units.0.requires.1.name=net.certiv.bent.core
units.0.requires.1.greedy=false


The plugin is pretty much as minimal as I can make it -- the only dependencies are on the asm.jar and

Import-Package: org.osgi.framework;version="1.7.0",
 org.osgi.framework.hooks.weaving;version="1.0.0",
 org.osgi.service.prefs;version="1.1",
 org.osgi.util.tracker;version="1.3.1"


Any suggestions as to what to change or try next would be appreciated.

Thanks...
Previous Topic:Custom key/trust stores
Next Topic:p2.inf vs product definition
Goto Forum:
  


Current Time: Wed Aug 20 20:24:10 EDT 2014

Powered by FUDForum. Page generated in 0.09328 seconds