Hi Karaf Team,
I have struggled a bit to create a small example project for Karaf.
There are two problems that hit me and that I think could be improved.
I wanted to register a simple servlet so it can be reached on
http://localhost:8080/test
The first thing was that the http service did not run on any port after
installation of the http feature "features:install http".
Luckily I recently worked on a karaf distribution for Talend so in the
end I was able to peek there and find that the "org.ops4j.pax.web.cfg"
file was missing.
After copying the file and setting the port number it worked.
Then I wanted to install the HttpServlet using the whiteboard pattern. I
found that CXF does this for the http transport but it did not work for me.
This took me a bit longer. Evenutally I found that installing the pax
web whiteboard extender did the job:
install mvn:org.ops4j.pax.web/pax-web-extender-whiteboard/0.7.4
So my proposal is to include the config file "org.ops4j.pax.web.cfg"
with a port set to 8080 in the karaf distro. The file does not hurt and
will not open a port
till the http feature is installed. Besides hat I propose to include the
pax web whiteboard extender in the http feature as I think registering
servlets with the
whiteboard pattern is a very good practice.
What do you think?
Christian
--
----
http://www.liquid-reality.de