felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjun Panday <arjun.pan...@alcatel-lucent.fr>
Subject ServiceTracker issue in DependencyManager..
Date Mon, 17 Nov 2008 14:28:11 GMT
Hi Marcel..

I noticed that the ServiceTracker in DependencyManager filters either on 
the given class name OR the given filter, but not both (see 
ServiceDependency.start(Service))
I found this to be an issue since i happen to register several types of 
object with the same set of properties (they refer to the same source)
The consequence is that I am then called back with the wrong kind of 
object and end up with an IllegalArgumenException.

Why this limitation when the underlying 
BundleContext.getServiceReferences() allows to filter on both class name 
and ldap filter?
Note: I understand that it may be worked around by adding the 
objectClass information to my filter, but it seems counter-intuitive 
since the setService method already takes the service class as first 
parameter.

Thanks a lot for your support..
Arjun

PS: Please check the following stack trace (i added instance information 
to your original debug message to show the problem)
2008-11-17 14:57:08,520 ConfThread ERROR osgi  - Exception while trying 
to invoke method protected void 
com.alcatel.as.proxylet.deployer.impl.SimpleProxyletApplicationImpl.bindConfig(java.util.Dictionary)

with [class 
java.util.Dictionary]/[com.alcatel.as.service.mbeanparser.impl.MBeanDescriptorImpl@9bad5a]
java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.felix.dependencymanager.ServiceDependency.invokeMethod(ServiceDependency.java:324)
        at 
org.apache.felix.dependencymanager.ServiceDependency.invokeCallbackMethod(ServiceDependency.java:302)
        at 
org.apache.felix.dependencymanager.ServiceDependency.invokeAdded(ServiceDependency.java:204)
        at 
org.apache.felix.dependencymanager.ServiceDependency.addedService(ServiceDependency.java:192)
        at 
org.apache.felix.dependencymanager.ServiceTracker$Tracked.track(ServiceTracker.java:797)
        at 
org.apache.felix.dependencymanager.ServiceTracker.open(ServiceTracker.java:197)
        at 
org.apache.felix.dependencymanager.ServiceDependency.start(ServiceDependency.java:160)
        at 
org.apache.felix.dependencymanager.ServiceImpl.startTrackingOptional(ServiceImpl.java:504)
        at 
org.apache.felix.dependencymanager.ServiceImpl.activateService(ServiceImpl.java:434)
        at 
org.apache.felix.dependencymanager.ServiceImpl.access$000(ServiceImpl.java:42)
        at 
org.apache.felix.dependencymanager.ServiceImpl$3.run(ServiceImpl.java:118)
        at 
org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:29)
        at 
org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:66)
        at 
org.apache.felix.dependencymanager.SerialExecutor.execute(SerialExecutor.java:50)
        at 
org.apache.felix.dependencymanager.ServiceImpl.calculateStateChanges(ServiceImpl.java:140)
        at 
org.apache.felix.dependencymanager.ServiceImpl.start(ServiceImpl.java:250)
        at 
org.apache.felix.dependencymanager.DependencyManager.add(DependencyManager.java:56)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message