Hi Sergio, Yeah, the osgi.remote.configuration.pojo.httpservice.context property is currently not yet supported for multiple interfaces... What should work though is *not* specifying this property. This should then use the default context for each interface. So if your service is exporting both org.acme.A and org.acme.B on a single service that should give you http://<rootctx>/org/acme/A and http://<rootctx>/org/acme/B.
Have a look at the Spring-DM demo docs, which describe how this is done... I haven't tried this yet with the HTTP service - but it should work there too. Best regards, David On 28 April 2010 09:24, Sergio Blanco Diez <[email protected]> wrote: > 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 > >
