1
votes

When my Felix (OSGi) starts it launches Felix Web Console bundle. This bundle uses Jetty which uses the felix property org.osgi.service.http.port to determine which HTTP port number to use.

One of my bundles on OSGi, developed by myself requires Grizzly to deal with WebSockets and so forth, therefore, one of the bundles that is also launched by OSGi is Grizzly OSGi HTTP Server bundle. Which attaches a web server to the HTTP port defined in org.osgi.service.http.port.

This causes a collision of HTTP ports. The dilema, I need both Felix Web Console and Grizzly. For what I'm concerned, Grizzly can run on a different por. But it seems to be lacking means to achieve this task.

Has anyone had this problem before? This issue from 2009 reflects this problem and it seems that Grizzly team fixed it, since I'm using the last release version 2.3.18, I can't see why I'm facing this problem.

1

1 Answers

1
votes

After investigating on this HTTP port conflict problem. I got intrigued why Felix Web Console requires Jetty in particular. So I decided to remove Felix Web Console bundle from Felix, and I downloaded it from Maven Central along with it's dependencies.

During this process I haven't seen any dependency on Jetty, so my guess is that I was including Jetty to serve Felix Web Console by mistake.

After doing this, Felix Web Console seems to get along really well with Grizzly Http Service!

Just for curiosity, I decided to look into Felix Web Console code and on their code they have a class called OsgiManager. This clever class binds Felix Web Console to the first HTTP Service found.

This is why HTTP services look by default to the OSGi property org.osgi.service.http.port. There is supposed to exist only one HTTP Service at a time within Felix, which makes sense. Therefore, because I removed my Jetty bundles that I though to be related with Felix Web Console, everything started working because now Grizzly HTTP Service become the only HTTP Service available. That why this all worked in the first place!