Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » HttpService and ServiceTracker(The ServiceTracker is started but no HttpService is found?)
HttpService and ServiceTracker [message #1731742] Mon, 09 May 2016 17:53 Go to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I don't register the servlet in web.xml as I want the OSGi part to take care of that.

In start(BundleContext) I register a ServiceTracker for HttpService and expect the "addingService" from my ServiceTrackerCustomizer to be called but it isn't happening.

I am using virgo-tomcat-server-3.6.4.RELEASE and things like /admin are working correctly.

Do I have to explicitly start the org.osgi.service.http.HttpService somewhere?
icon5.gif  Re: HttpService and ServiceTracker [message #1731757 is a reply to message #1731742] Mon, 09 May 2016 23:03 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I found this 5 year old blog post by Christopher Frost: http://chrisfrost.com/eclipse-rt/extending-virgo-with-a-httpservice/

(Is this still the way to do it?)

In his blog he states:
Quote:
Several people have asked about us providing a packaging of Virgo that includes the OSGi HttpService. We don't have any plans to do so because it's so easy to extend Virgo with extra function yourself.


Surely as an OSGi based server, providing OSGi Services, it would be normal to assume that an enterprise class OSGi server, that already has tomcat or jetty, would automatically provide the OSGi specified "HttpService" too ( to clarify, I'm not asking about the integration in the Virgo kernel, but it the tomcat and jetty variants).

If it is, as Christopher put it "it's so easy to extend Virgo with extra function yourself", then why not have this "easy" part in every Virgo Enterprise Web server?
Re: HttpService and ServiceTracker [message #1731781 is a reply to message #1731742] Tue, 10 May 2016 07:18 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 49
Registered: November 2015
Member
Hi Bill,

I am not really familiar with this, because I normally prefer WAB bundles over the OSGi HTTP Service (in WAB bundles you have the full power of web.xml to declare filters, servlet mappings etc.)

This said I believe you may be able to use the HTTP Service as follows:


  1. get the Equinox bundle for OSGi HTTP Service [1]
  2. copy the bundle into a Virgo repository folder
  3. create a Virgo plan that lists that bundle
  4. copy the new plan into a Virgo repository folder
  5. modify org.eclipse.virgo.kernel.userregion.properties and add the plan id to the initialArtifacts property.


This is how you "extend" Virgo with custom components that get started automatically when Virgo boots, before starting any application plan contained in the pickup folder. For further details please refer to the Virgo documentation about the initialArtifcats property.

[1] http://www.eclipse.org/equinox/server/http_in_equinox.php

GianMaria.


Re: HttpService and ServiceTracker [message #1732016 is a reply to message #1731781] Wed, 11 May 2016 19:00 Go to previous message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
Hi GianMaria,

I'm going to have to combine both solutions due to the peculiarities of the implementation.

I checked out the link you provided and it appears that the information there is based on a package that no longer exists and the "jetty" alternative relies on mortbay jetty 5.1.11 (now up to eclipse jetty 9.x).

I shall have to try out a combination of the the latest o.e.equinox.http.* and o.e.jetty bundles to see what I can get working.

This promises to be an interesting challenge, as the final implementation will have both a jetty and tomcat server implementations running.
Previous Topic:How do I configure SPNEGO authentication?
Next Topic:OSGI fragment bundle not connected to websockets deployed in Virgo nano
Goto Forum:
  


Current Time: Sat Nov 17 19:38:49 GMT 2018

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

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

Back to the top