Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Posts Tagged ‘p2’

on Aug 17th, 2009Building Your Equinox OSGi Application Server – Part 2

In my previous post, I described how to easily build an Equinox-based web application server that can be run on any servlet container. Note that in the previous post I had these instructions for completing the export wizard dialog

d) The Generate metadata repository should be unchecked

If using p2 (as in this post), this is incorrect.  It should say

d) The Generate metadata repository should be checked (to include p2 metadata)

I’ve updated this documentation in the original posting.

Once your p2-enabled app server is running, you can do some really cool things with it.  For example, since p2 is available, you can dynamically install new components into your running application server.  Here’s the OSGi console help output (part of it anyway):

sbp21 Building Your Equinox OSGi Application Server   Part 2

Notice the Provisioning Commands text.  These are console commands enabled by the presence of p2 that allow you to do common provisioning operations like installing new components.  In this blog entry, I’ll show how to install a version of the Knoplerfish httpconsole, but the same approach applies to software available from other p2 repositories.  In other posts, the EclipseSource team will show how to do this hot deployment into a running server for:

First, one must add the metadata and artifact repository URIs using the provaddrepo and provaddartifactrepo commands:

sbp221 Building Your Equinox OSGi Application Server   Part 2

Notice the provlg command, which lists the p2 groups available in the newly added repositories (in this case, the Knopplerfish httpconsole v2.0.0).  Now, issue the provinstall command with the feature group and version… wait a few seconds and you should see the install complete message

sbp232 Building Your Equinox OSGi Application Server   Part 2

Then issue the confapply command (this command applies the new bundle configuration to the currently running platform):

sbp24 Building Your Equinox OSGi Application Server   Part 2

Now, you can see the new bundle installed via the short status (ss) command:

sbp25 Building Your Equinox OSGi Application Server   Part 2

To start the httpconsole bundle (and activate the servlet that it runs) just type start 50.

At this point, you can open a web browser, and point it at your Equinox application server now running the httpconsole at http://localhost:8080/myappserver/console and magic…your application server is now running the Knoplerfish httpconsole servlet, which provides a web interface to the list of running bundles:

sbp26 Building Your Equinox OSGi Application Server   Part 2

Just for fun, you can stop the httpconsole with stop 50 and the servlet will no longer respond

sbp27 Building Your Equinox OSGi Application Server   Part 2

You can start it back up, and then the servlet will be running again. This makes a nice demo for people that have to manage the install and update of new components into a running application server. In future posts, I’ll show how to add features to your application server statically (during the build, rather than at runtime) as well as how to use ECF remote services to manage a running application server without having to use the OSGi console.

Enjoy!

on Aug 15th, 2009Building Your Equinox OSGi Application Server – Part 1

Over the past year I’ve developed a goal of making it easier to build and deploy the Equinox runtime as a web application server.  Not only does this fit my technical skills having previously worked on a commercial application server, it also fits my technical interests. It also seems that an ever increasing set of other people have been interested in running the Equinox OSGi runtime as a application server. Furthermore, many people may not be aware that there are now a number of really excellent  technologies available via the EclipseRT project that are relevant to creating modern application servers:

There’s a lot more to come, for example, ECF’s work on supporting Google Wave server protocol as well as commercial technologies from EclipseSource and other technology companies devoted to the OSGi stackless stack.

However, in my opinion it’s far more difficult to build, deploy, configure and run an Equinox server than it should be.  There is existing documentation on doing so from scratch here, but it is a little dated.  I am contributing to the Equinox project to get the documentation updated with community help.

So, I would like to do a short set of blogs about building your own Equinox-based application server.  Hopefully this will be helpful to those who are interested. It’s possible to create two ‘kinds’ of Equinox-based application servers. Those that are actually run stand-alone (i.e., as a Equinox OSGi application) or those that are run within an existing servlet container such as Jetty or most commercial application servers.  For this series, I’m going to focus on the servlet container method as I think this will ultimately be the more common and popular method. Furthermore, servlet containers now make deployment, installation and configuration very easy (which goes a long way toward my goal).

Ok, so how to create an Equinox-based application server?  Well, with the Eclipse Galileo PDE build, p2, features, and products, it turns out it’s now very easy to do so (compliments to the particularly to the folks who worked on PDE, Equinox, and P2 in this area).  I’ve created a simple feature and product that does so and contributed them to this bug.  Here are the steps:

1) Download the zip attached to bug 245267

2) In Eclipse, open a new workspace and import the projects from the downloaded zip (File->Import…->Existing Projects in Workspace->Select Archive File).  This will put two very small projects into your workspace

 Building Your Equinox OSGi Application Server   Part 1

3) There are two other projects (from Equinox CVS area) required before you can create your app server.  To add these projects right click on the equinox-servletbridge.psf file and select Import Project Set…  from the menu (use anonymous CVS login when prompted).  Now you should have four projects in the workspace

sbimport1 Building Your Equinox OSGi Application Server   Part 1

4) Now, open the PDE product editor by double clicking on equinox-milli.product file

5) Select Eclipse product export link in lower right of product editor

sbexport1 300x165 Building Your Equinox OSGi Application Server   Part 1

6) In the export wizard dialog set the following fields

a) The Root Directory field must be set to:  WEB-INF

b) The Synchronize before exporting check box can be unchecked

c) The Destination must be set to Archive file, and given a location/name of your choosing (e.g. myappserver.zip)

d) The Generate metadata repository should be checked (to include p2 metadata)

sbexport21 Building Your Equinox OSGi Application Server   Part 1

e) Click Finish

This will run PDE build and create a zip named (in the above case): myappserver.zip

6) Now comes the fun part.  Simply rename this zip file to a .war…i.e. myappserver.war

7) Start your servlet container (in this case I’m using tomcat)

tomcat1 Building Your Equinox OSGi Application Server   Part 1

icon cool Building Your Equinox OSGi Application Server   Part 1 Hot deploy the war file (in this case myappserver.war) in the manner appropriate for your servlet container (in tomcat’s case this is copying the myappserver.war file into the webapps directory).  After a few seconds, you should see something like the following output to the tomcat console…with the nice little osgi> prompt, indicating your Equinox server is deployed and running!

tomcat2 Building Your Equinox OSGi Application Server   Part 1

9) Give some OSGi console commands with the osgi> prompt just to convince yourself everything is working…e.g.

tomcat3 Building Your Equinox OSGi Application Server   Part 1

10) Go show your colleagues how easy it was to create, deploy and run your Equinox application server!

There’s a lot more that you can now do with your Equinox application server like:

  • Adding servlets (via bundles)
  • Using P2 to update your application server
  • Creating your web applications in a modular fashion using bundles and features
  • Reuse your favorite bundles from Eclipse or other projects
  • Deploy and maintain your web application as bundles (and using PDE to do it)

In the future, I’ll describe how to do some of these things.

If people are interested in particular things to do, please comment and let me know.

on Aug 15th, 2009Webinar: p2 and Eclipse RCP

There has been a lot of talk lately about p2.  While many people know p2 as the update mechanism used by Eclipse, it is in fact a general purpose provisioning platform.  This means you can use the provisioning platform as a base to build a highly customized provisioning solution for your own needs… whether it is an Eclipse application, OSGi application or anything else.

On September 15, I will be presenting an introduction to p2. In particular, I will demonstrate how you can use p2 to build a provisioning solution for Eclipse RCP applications. The webinar will teach you how you can:

  • Make use of the p2 provisioning platform for software management
  • Integrate the creation of p2 repositories into your build system
  • Reuse the p2 user interface and existing work-flows
  • Customize the p2 user interface for your specific needs
  • Debug common pitfalls

For more information, please see the registration page.

If you want anything else discussed about p2 in the webinar, please leave a comment and if there is time, I will try to get to it.

on Jul 20th, 2009Equinox OSGi Webinar Online

As Jeff McAffer noted, the webinar on OSGi we did a couple weeks ago is finally online.

We decided to break it up in a series of six parts for your viewing pleasure.

Part 1 – History and Vision

osgipt1 300x224 Equinox OSGi Webinar Online

Part 2 – Fundamental Concepts

osgipt2 300x224 Equinox OSGi Webinar Online

Part 3 – OSGi Tooling

osgipt3 300x224 Equinox OSGi Webinar Online

Part 4 – OSGi Services

osgipt4 300x224 Equinox OSGi Webinar Online

Part 5 – ServiceTracker and Declarative Services

osgipt5 300x225 Equinox OSGi Webinar Online

Part 6 – Deploying OSGi Systems and Q&A

osgipt6 300x224 Equinox OSGi Webinar Online

Enjoy.

on Jul 17th, 2009OSGi and Equinox Webinar Posted

Last week Chris Aniszczyk and I did a free three hour OSGi and Equinox Jumpstart webinar.

Yesterday we posted the whole thing as a six part series of movies on the EclipseSource webcast site.

Check it out and let us know what you think!

osgiwebinar 300x225 OSGi and Equinox Webinar Posted

The webinar was aimed at people who’ve heard the buzz around OSGi but still don’t have a great feel for what it is, what you do with it and how it helps. We covered a pretty broad range of topics from the overall vision and context for OSGi to key concepts like bundles, classloading and componentization as well as PDE tools for writing bundles. Quite a bit of time was spent talking about services and best practices, in particular declarative services (though we did not have enough time to talk about OSGi distributed services). We also spent time talking about p2 provisioning of OSGi bundles and showed some of the scenarios where OSGi’s dynamic module system shine.

Overall the response was great.  We were experimenting a bit with the format and basically did thirty minute chunks covering a topic and then a few minutes to cover questions that people typed in. Several hundred people signed up from all over the world and turnout on the day was awesome. The format seemed to be compelling as even though the webinar was pretty long (we were completely wiped by the end) the vast majority of the attendees stayed to the end.

The EclipseSource team has been doing a number of webinars over the past months including some on RAP single sourcing, p2 and our Yoxos products. We have a plan for more webinars including ones on ECF, Zest and other projects in which we are involved. 

Stay tuned for details!

on Jul 9th, 2009EPP Download Wizard

Previously, I blogged about the current state of the Eclipse Packaging Project (EPP) Wizard. I have good news, the EPP wizard is now officially available.

The wizard has been embedded in our own company download site under the Customize Download button. If you start on the Eclipse Foundation download site and chose to download your packages from EclipseSource, you have the option to download an unmodified package from the Cloud but also the possibility to use the EPP Wizard to create your own download. If you select the latter option, the wizard will be opened with the package content you already selected on the Eclipse download site. If you are satisfied with your selection just go to the finish page of the wizard and select the packages you want to install.

Can you spot the difference in the screenshots bellow?

AvailableSoftwareRight 300x179 EPP Download Wizard

Install new Software Dialog with Update Site Management

AvailableSoftwareWrong 300x178 EPP Download Wizard

Install new Software Dialog without Update Site Management

We found out that some installations created with the EPP Wizard don’t have the p2 UI for management of repositories (update sites). The available update sites are shown under Preferences > Install/Update > Available Software Sites and under Help > Install New Software… but you don’t have the possibility to edit them. This issue was fixed last week but if you have an older installation and the update sites management functionalty is missing you have to change the start options of the bundle org.eclipse.equinox.ds to get it. The start options associated with bundles are saved into the bundles.info located under eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info (in this case eclipse is the directory of your eclipse installation). Just change the start options of the bundle org.eclipse.equinox.ds from “4, false” to “2, true” and restart your eclipse.

The EPP Download Wizard integrates Yoxos OnDemand as external service provider. Yoxos OnDemand is a free Eclipse download and update service we provide. Yoxos OnDemand provides access to additional third party content which is not available from the EPP Wizard. However, from the EPP Wizard, you can continue your download with Yoxos without losing time because your selection will be sent to Yoxos.

If you encounter other problems or have ideas how to improve the wizard please send us feedback through our feedback form on our download site.

on Jul 1st, 2009Training for Eclipse Galileo and p2

As part of the Eclipse Galileo release, we updated all of our training courses to reflect the latest release:

We have also added two new courses to cover two popular topics, Equinox p2 and migrating to Galileo RCP:

We are also offering our courses online now. If you’re interested in any of these courses, please email us.

on Jun 25th, 2009100000 Galileo package downloads in 24 hours

Twenty-four hours after opening the flood gates and releasing Galileo I thought I could provide some statistics. Over a year ago I started one of my talks at EclipseCon announcing that every 3 seconds someone starts a download of a packages that we create in my Eclipse Packaging Project.

But everything is different in the first few days after a release. When I checked the download page and the download counter I calculated that there were about 100000 downloads of the packages (including the ‘classic’ SDK). This means that every 0.9 seconds a package has been downloaded! Cool. Just a few more numbers:

  • Java EE package with more than 50000 downloads so far
  • Total amount of data (all packages): More than 15 TBytes (15000 GBytes!)
  • Average bandwidth necessary to serve this data: 1600 MBits/s

Then I checked the logfiles of our own EclipseSource servers. In addition to our download mirrors we decided this year to provide package downloads from the Cloud. Maybe you have seen then new download links to Eclipse members on the download page:

getItFasterFromEclipseSource 300x208 100000 Galileo package downloads in 24 hoursIf you choose our “Get It Faster Here” offering you are downloading the packages from Amazon Cloud Front. It is hard to say how many people were using this service in the first 24 hours, because many people were using download managers (something that prevents me from providing exact numbers based on the logfiles). But what I can provide here is a statistic about the download speed in MBits per second:

howFastYouGetEclipse 300x91 100000 Galileo package downloads in 24 hours

You can see that most people are sitting behind Internet connections that can deliver 5 to 20 MBits/s, but some have really fast pipes. For example, I was testing our downloads from a large research facility here in Germany and I got a download speed of more than 280 MBits/s!

I think that’s great. You don’t have to wait for downloads any more!

on Jun 25th, 2009Equinox p2 User Interface Feedback?

As we learned from Ian Bull, p2 has come a long way for the Galileo release.

Now that Galileo has shipped, a lot of the Eclipse development teams are going on vacation or starting the planning process. In particular, the p2 team is looking for ideas on how to improve the user interface in Eclipse 3.6 and Helios.

p2ui 300x248 Equinox p2 User Interface Feedback?

If you have any problems with the current user interface or would like to see some enhancements, please comment!

Collaboration in open source is a two way street!

If you aren’t convinced that your feedback matters, just asked some of the people that the p2 team thanked on the Eclipse 3.5 acknowledgements list.

on Jun 24th, 2009p2 Provisioning, Eclipse Galileo Feature #1

Today is the big day! Eclipse 3.5 – Galileo – is available for the general public. To count down the final push towards Galileo, I have been reviewing the Top 10 features that I’m most excited about. There are tons of other great features – such as the SWT port to Cocoa – that I personally don’t make use of, so if you disagree with my Top 10 list, I encourage you to publish your own.

A quick recap of what I have reviewed so far:
10. Enhancements to the Java compare editor
9. Improved Java 2 Javascript Bridge
8. The new RAP Look and Feel
7. EMF Ultra Thin Diet
6. Install into self
5. Memory Analyzer Project
4. Mylyn Wikitext
3. Improved Target Platform Management
2. OSGi Declarative Services

And without further ado, the Number 1 Galileo feature (according to me) is – p2, Round 2.

The Eclipse provisioning platform (p2) was originally released as part of Eclipse 3.4. At the time it provided a solid replacement for Update Manager, with the scaffolding in place to enable it to be a true provisioning platform. As of Eclipse 3.5, I can say that p2 is now a full fledge platform for provisioning everything and nothing in particular.

During the past year, p2 has been updated and improved in a number of different areas. New features were added, over 1,000 bugs were closed, workflows were revamped and even the helpful error messages were improved.

The uber-talented UI designer – Susan F. McCourt – reworked the entire p2 workflow. The repositories lists have been updated, the installed software views received a face lift and the “Install New Software” wizard has been completely revamped to support a more asynchronous user experience. Susan also provided a number of extension mechanisms so you can make use of the p2 UI in a number of different ways within your own RCP application.

install new p2 Provisioning, Eclipse Galileo Feature #1
installed p2 Provisioning, Eclipse Galileo Feature #1

Jeff McAffer designed the publisher, a new mechanism for writing repositories. The publisher provides a flexible method for working with p2 metadata. Andrew Niefer – the workhorse behind PDE Build – provided a lot of the publisher polish, and even re-worked PDE Build to use this new technology.

Henrik Lindberg contributed “Chester the test-data molester” an environment that helps test p2 using a variety of error scenarios. Using this, p2 can be tested against network problems, invalid modify dates, invalid file sizes, endless redirects, etc… Henrik also worked extremely hard on p2 transport layer. Below the transport layer, Henrich Kraemer, Scott Lewis and the ECF team provided a new provider based on the Apache httpclient.

In the p2 planner, the part that actually computes what needs to be installed, Daniel Le Berre – as part of his research studies – improved the explanation support. This means instead of getting a long winded explanation when you try to install conflicting bundles, you get a concise error message outlining the root of the problem.

explain1 300x96 p2 Provisioning, Eclipse Galileo Feature #1

DJ Houghton provided bug fixes all over p2 including many of invaluable tools such as mirroring, the director, the p2 garbage collector and the publisher.

One of the coolest features – meta requirements – was implemented by Simon Kaegi. Using meta requirements you can now ship the code to help install your software, along with your software.

John Arthorne helped a number of contributors earn their commit rights by providing true mentorship and advice. Additionally, John managed to fix a few hundred bugs, implement composite repositories, cleanup the p2 metadata implementation, fix a number of p2 caching problems, and generally improve the scalability and performance of p2.

While everyone worked very hard, the biggest kudo for p2 goes out to Pascal Rapicault, the p2 team lead. Pascal knows p2 inside-and-out and managed to assemble an excellent provisioning platform despite the occasional poorly worded bug report. Great job Pascal!

Next year’s project planning is starting now. Personally I would love to see even better scalability (client – server repository models), improved repository tooling and tighter integration with the target platform management.

Thanks for everyone on the p2 team, and all committers, contributors and users who made the Galileo release possible.

Enjoy the rest of the day, and tomorrow everyone should be back at work on Helios.

© EclipseSource 2008 - 2011