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 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

#create a IU fragment named configure.<org.myBundle><org.myBundle>
units.0.instructions.unconfigure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:-1); \
units.0.instructions.configure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:3); \
units.0.hostRequirements.1.range=[<v>, <v>]
units.0.requires.1.range=[<v>, <v>]

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: 32491
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:
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 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",

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: Sat Sep 24 23:16:21 GMT 2022

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

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

Back to the top