Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox/p2/Webapp QuickStart

< Equinox‎ | p2
Revision as of 13:05, 25 June 2007 by Simon kaegi.ca.ibm.com (Talk | contribs) (New page: == Quickstart - Using Equinox Provisioning in a Web Application == The Equinox provisioning work has in the past been used to demonstrate its use deploying rich client applications howev...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Quickstart - Using Equinox Provisioning in a Web Application

The Equinox provisioning work has in the past been used to demonstrate its use deploying rich client applications however it’s equally relevant for server-side applications. This Quickstart will provide a WAR file that is an amalgamation of the servletbridge and new provisioning work. The servletbridge handles the launching of Equinox and provides a conduit for HTTP requests but is otherwise not involved in the management of bundles running in an installation. As compared with the current release (3.3) the way we’re going to manage the installation of bundles is significantly different and we'll demonstrate the new provisioning work by installing new functionality into an exisiting server application.


What you’ll need….

1) A servlet container (I suggest the latest version of either Tomcat or Jetty). We’re going to be using the OSGi console so it would simplify things if you can use StdIn/Out. If not you will have to tweak the web.xml to use a remote port.

2) Provisioning WAR file -- here In Eclipse 3.3, the update configurator bundle (org.eclipse.equinox.update.configurator) would traverse your eclipse/plugins directory and install all bundles it found. For this quickstart we’re going to do things a little differently. Rather than just installing everything the provisioning work will generate a metadata repository to represent the various requirements and capabilities of each bundle.

3) Repository WAR file -- here For the purposes of this quickstart we’re going to install this WAR file in the same Servlet container however it’s meant to represent a remote metadata repository similar to an Eclipse Update site.


Instructions…

1) Install the two WAR files in your Servlet container and start it up. (e.g. in Tomcat place copy the two WAR files to your webapps directory and run bin/startup.bat or bin/startup.sh)

2) The OSGi console should start automatically and you should see the OSGi prompt (e.g. “osgi>”). At the prompt type “ss” to see the list of the bundles that makes up our base provisioning agent.

Note: You might notice the org.eclipse.equinox.prov.selfgenerator is STARTING. This bundle produces the initial metadata repository and profile that describes the contents of the plugins folder and the software currently installed. After it’s STARTED we’re ready to proceed.

3) Let’s add a metadata and artifact repository so we can provision some new functionality Type “?” to list the console commands. You should see a number of the new provisioning commands.

Type the following in the console:

You can use the “provlr” and “provlar” commands to examine the contents of the repositories if you like.

4) The repositories contain the metadata for adding JSP support and a simple helloworld example. Let’s install into our current profile.

Type:

  • provinstall org.eclipse.equinox.jsp.examples 1.0.0 eclipse.prov.profile.current
  • confapply

5) Type “ss” to view the newly installed JSP bundles. In addition to the jsp examples bundle all of its required dependencies have been installed. You can now visit http://localhost:8080/provbridge/helloworld.jsp to see the JSP page you’ve just provisioned.

Back to the top