ServiceReference cast exception, in Composite
---------------------------------------------

                 Key: FELIX-990
                 URL: https://issues.apache.org/jira/browse/FELIX-990
             Project: Felix
          Issue Type: Bug
          Components: iPOJO
    Affects Versions: iPOJO-1.2.0
         Environment: Java 1.6, Felix 1.4.0
            Reporter: Jonathan Bardin





This bug appear in a composite while you try to get an iPOJO Factory Service 
with its "composite ServiceReference" from the Global BundleContext.

Metadata:
-----------------------------------------------------------------------------------------------
...
<wbp:wbp 
filter="(&amp;(remote.proxy=true)(factory.state=1)(objectClass=org.apache.felix.ipojo.Factory))"
 
                              onArrival="bindFactory" 
onDeparture="unbindFactory" />
...
-----------------------------------------------------------------------------------------------

Code:
-----------------------------------------------------------------------------------------------
BundleContext m_globalcontext;
....
public IpojoProxyManager(BundleContext bc) {
        m_globalcontext = ((IPojoContext) bc).getGlobalContext();
        ....
 }
private void bindFactory(ServiceReference factoryref) {
        ....
        Factory factory = (Factory) m_globalcontext.getService(factoryref);   
// <--- ClassCastException
        ....
}
------------------------------------------------------------------------------------------------

Exception:
------------------------------------------------------------------------------------------------
-> [Thread-4] ERROR homega.remote.proxymanagers.ipojoproxymanager - [ERROR] 
homega.remote.proxymanagers.IpojoProxyManager : The onArrival method 
bindFactory has thrown an exception
     java.lang.ClassCastException: 
org.apache.felix.ipojo.context.ServiceReferenceImpl cannot be cast to 
org.apache.felix.framework.ServiceReferenceImpl
        at 
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:222)
        at org.apache.felix.framework.Felix.getService(Felix.java:2853)
        at 
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:357)
        at 
homega.remote.proxymanagers.IpojoProxyManager.__bindFactory(IpojoProxyManager.java:216)
------------------------------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to