Hello there,
I have a problem with D-OSGI and I can't find an explanation.
I am trying to register a service with multiple interfaces.
properties.put("osgi.remote.interfaces", interfaces.toArray(new
String[interfaces.size()]));
properties.put("osgi.remote.configuration.type", "pojo");
properties.put("osgi.remote.configuration.pojo.httpservice.context", "/"
+ device.getAddress().replace("/", "-"));
I thought this would somehow join the interfaces into one isngle virtual
interface of sorts, but it tries to register in the same context all the
interfaces, giving out an error from the second interface on because the
context is already taken:
org.osgi.framework.ServiceException: CXF DOSGi: problem registering CXF
HTTP Servlet
at
org.apache.cxf.dosgi.dsw.handlers.HttpServiceConfigurationTypeHandler.createServer(HttpServiceConfigurationTypeHandler.java:99)
at
org.apache.cxf.dosgi.dsw.hooks.ServiceHookUtils.createServer(ServiceHookUtils.java:86)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.createServer(CxfPublishHook.java:106)
at
org.apache.cxf.dosgi.dsw.hooks.CxfPublishHook.publishEndpoint(CxfPublishHook.java:80)
at org.apache.cxf.dosgi.dsw.Activator$1.run(Activator.java:164)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.osgi.service.http.NamespaceException: alias is already in
use in this or another context
at
org.ops4j.pax.web.service.spi.model.ServerModel.addServletModel(ServerModel.java:120)
at
org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:145)
at
org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:54)
at
org.apache.cxf.dosgi.dsw.handlers.HttpServiceConfigurationTypeHandler.createServer(HttpServiceConfigurationTypeHandler.java:96)
... 7 more
Is this the expected behauviour? Must I register each interface
separately in different contexts?
Thanks in advance!
--
Sergio Blanco Diez ([email protected])
MoreLab - Mobility Research Laboratory (http://www.morelab.deusto.es)
Tecnológico Fundación Deusto (http://www.tecnologico.deusto.es)
Tlf: +34 944139003 Ext. 2928