Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Controlling dependency startLevel(Seeking help in configuring dependency bundle start levels.)
Controlling dependency startLevel [message #1839177] Tue, 16 March 2021 20:43 Go to next message
Adam Saturna is currently offline Adam SaturnaFriend
Messages: 4
Registered: March 2021
Junior Member
We are using p2 to provision our servers using p2 Update Sites that we build.
Recently, I have upgraded Jetty to a newer version. Our UpdateSite contains all required jetty bundles. Some of our bundles contain JSP pages. The default bundle startLevel is 4, and so when we provision our changes, Jetty + our own bundles end up with startLevel 4 in bundles.info file.

This is an issue because if our JSP containing bundles start before jetty bundles that offer JSP support, the Bundle Tracker will miss them and will not configure WebAppContext correctly.

I need org.mortbay.jasper-apache-jsp bundle to start before our bundles do.
I have tried unpacking the source bundle jar and added p2.inf file inside META-INF directory and repacked the jar.

I can't get it to work correctly, the following is my p2.inf content:

#create a requirement on the fragment we are creating
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name=configure.org.example.bundle
requires.0.range=[$version$,$version$]
requires.0.greedy=true

#create a IU fragment named configure.<org.myBundle>
units.0.id=configure.<org.myBundle>
units.0.version=$version$
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=configure.org.example.bundle
units.0.provides.1.version=$version$
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:3); \
                               org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true);
units.0.hostRequirements.1.namespace=osgi.bundle
units.0.hostRequirements.1.name=<org.myBundle>
units.0.hostRequirements.1.range=[<v>, <v>]
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=<org.myBundle>
units.0.requires.1.range=[<v>, <v>]
units.0.requires.1.greedy=false


When I include this in the jsp bundle, the provisioner fails to install the bundle.
I have tried debugging with org.eclipse.equinox.p2.core/planner/projector=true but that doesn't give me a lot of info why the config fragment dependency is not satisfied.

Any suggestions how I can get this to work? I've been extensively searching the web but no luck.
Re: Controlling dependency startLevel [message #1839188 is a reply to message #1839177] Wed, 17 March 2021 09:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This might be a stupid suggestion, but it might be simpler to have your JSP-containing bundles require the Jetty bundles as a way to ensure that the Jetty bundles start before your bundles.

I don't suppose your installation is based on *.product such that you can control the start levels of plugins viathe <configuration> of the *.product file?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Controlling dependency startLevel [message #1839209 is a reply to message #1839188] Wed, 17 March 2021 14:38 Go to previous message
Adam Saturna is currently offline Adam SaturnaFriend
Messages: 4
Registered: March 2021
Junior Member
Hi Ed,

Our bundles containing JSP pages already do this, but unfortunately, it doesn't resolve the issue. I will look into debugging the starting order some more to have a better understanding of when the bundle tracker is invoked (might be on installed step).
We don't make a use of .project file, we have written a Provisioner implementation to handle provisioning and p2 profile changes by executing a ProvisioningPlan. The bundles.info file is used by the profile to dictate the starting order.

Manifest file includes the following requirements:
Require-Bundle: org.eclipse.jetty.apache-jsp;bundle-version="9.4.37",
 org.mortbay.jasper.apache-jsp;bundle-version="8.5.54",
 org.mortbay.jasper.apache-el;bundle-version="8.5.54"



Previous Topic: javax.annotation : osgi uses constraint violation
Next Topic:org.eclipse.equinox.http.servlet fails to get the right paths
Goto Forum:
  


Current Time: Wed Apr 24 17:03:17 GMT 2024

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

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

Back to the top