Hi Jerome,
maybe you can instead just avoid that the CXF servlet is installed in
the first place:
https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
See the property org.apache.cxf.osgi.http.transport.disable
Christian
Am 13.08.2015 um 21:42 schrieb Jérôme Revillard:
Dear all,
Since a couple of days, I'm trying to secure or web services which are
running inside a Karaf 4 container with keycloak
(http://keycloak.jboss.org).
I followed a bit the demo here:
https://github.com/keycloak/keycloak/tree/master/examples/fuse and
more particularly the "*Builtin web applications*" part which is here
to secure the all /cxf context.
I had to update different things to be able to work with Karaf 4 but,
I cannot make it working because I cannot get access to the cxf
servlet. If you look at the blueprint.xml
<https://github.com/keycloak/keycloak/blob/master/examples/fuse/cxf-jaxrs/src/main/resources/OSGI-INF/blueprint/blueprint.xml>
file, you can see:
<bean id="defaultCxfReregistration"
class="org.keycloak.adapters.osgi.ServletReregistrationService"
depends-on="cxfKeycloakPaxWebIntegration"
init-method="start" destroy-method="stop">
<property name="bundleContext" ref="blueprintBundleContext" />
<property name="servletReference">
<reference interface="javax.servlet.Servlet" filter="(alias=/cxf)"
timeout="5000" />
</property>
</bean>
Unfortunately, this bean is never instanciated because there is no
"javax.servlet.Servlet" registered as service as it "should" be as
written in ServletReregistrationService.java
<https://github.com/keycloak/keycloak/blob/5301b556f09a8e06b8d2fd8c957c5b2a6251e3ab/integration/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/ServletReregistrationService.java>:
"Service, which allows to remove previously registered servlets in
karaf/fuse environment. It assumes that particular servlet was
previously registered as service in OSGI container under {@link
javax.servlet.Servlet} interface."
I can get access to the ServletExporter but, the servlet object is
private there, without anyway to retrieve it.
Could somebody help me to solve this issue please ? Would there have
another approach ?
Thanks in advance!
Jerome
--
=====================================================
Dr Jérôme Revillard
CTO MAAT/GNUBILA France
www.gnubila.fr
174 Impasse des Prés d'en Bas
74370 Argonay (France)
Mob. 0033 676 108 185
Tel. 0033 450 685 601
=====================================================