You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergio Blanco Diez <se...@deusto.es> on 2010/05/13 11:47:01 UTC

CXF D-OSGI does not register certain services

Hello again!

2 weeks ago I had a problem David Bosschaert helped me solve
(registering a service with multiple interface didn't work as expected).

Once I fixed that, I have a new problem that I can't seem to grasp.

I have a bundle that manages some devices. Each device implements a
service interface which I want to expose. I have the followin
interfaces:

Device
|-Alarm
|-Heating
|-OpeningSensor
|-Thermometer
|-SwitchableLight
 |-DimmableLight

Notice that all implement the Device Interface and that DimmableLight
implements SwitchableLight too.

Registration is done exactly the same for each device:

final Hashtable<String, Object> props = new Hashtable<String, Object>();
props.put("osgi.remote.interfaces",
getCorrectDeviceInterface(interfaces.toArray(new
String[interfaces.size()])));
props.put("osgi.remote.configuration.type", "pojo");
props.put("osgi.remote.configuration.pojo.httpservice.context", "/" +
device.getAddress().replace("/", "-"));
							
final ServiceRegistration registration =
context.registerService(getCorrectDeviceInterface(interfaces.toArray(new
String[interfaces.size()])),device,props);

interfaces is a List<String> with all implement interfaces for a class
and getCorrectDeviceInterface() gets the adecuate interface for the
device (and it is working as expected).

The devices I have in my testing environment are:

+ Thermometer
+ DimmableLight
+ DimmableLight
+ OpeningSensor
+ Alarm
+ OpeningSensor

And they come in that order in the device registering loop.

Now, the problem itself: DimmableLight devices are  getting registered
in OSGi with the appropiate parameters as the rest, but CXF omits them
without saying anything.

I attach to this email two text files, one for the console output (I'm
using Pax Runner) when I register any service except DimmableLight (note
that even though some exceptions ocur, it is working beatifully) and
another for a DimmableLight.

Any ideas about why CXF would simply omit that service? I have tried
lowering in in the hierarchy, registering it alone, ... but to no avail.

Thanks in advance!!! 



-- 
Sergio Blanco Diez (sergio.blanco@deusto.es)
MoreLab - Mobility Research Laboratory (http://www.morelab.deusto.es)
Tecnológico Fundación Deusto (http://www.tecnologico.deusto.es)
Tlf: +34 944139003 Ext. 2928

Re: CXF D-OSGI does not register certain services

Posted by Dmytro Pishchukhin <dm...@gmail.com>.
Hi,

I had the same issue with JAXB. It was fixed when I updated my JAXB library
to version 2.2.

Maven artifact:
            
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
     <version>2.2</version>
</dependency>


Hope it helps you.

-----
Best regards,
Dmytro
-- 
View this message in context: http://cxf.547215.n5.nabble.com/CXF-D-OSGI-does-not-register-certain-services-tp568211p1843324.html
Sent from the cxf-user mailing list archive at Nabble.com.