karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Marseille (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-3438) ClassCastException on blueprint service reference interface method call
Date Thu, 08 Jan 2015 14:12:35 GMT
Matthieu Marseille created KARAF-3438:
-----------------------------------------

             Summary: ClassCastException on blueprint service reference interface method call
                 Key: KARAF-3438
                 URL: https://issues.apache.org/jira/browse/KARAF-3438
             Project: Karaf
          Issue Type: Bug
          Components: karaf-core, karaf-osgi
    Affects Versions: 3.0.2
         Environment: Windows 7 64bits, Java jdk 1.7.0_u71, maven 3.2.5, no admin rights on
the platform.
            Reporter: Matthieu Marseille


I've tried to apply the Blueprint tutorial with a simple MyHelloService service implemented
as MyHelloServiceImpl and exposed to a client that gets this service as a reference. Both
starting the service and client bundles is clean, but when the client calls the simple and
unique method hello() of the service at startup (blueprint "init-method") I got :

Caused by: java.lang.ClassCastException: Proxy8b5c6c04_36f0_4691_ad01_007e338b9cc9 cannot
be cast to com.mycompany.blueprint.app.MyHelloService 
        at Proxydc340f70_a828_4e83_b591_845608690a75.hello(Unknown Source)
        at com.mycompany.blueprint.client.MyActivator.startUp(MyActivator.java:11)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_71]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_71]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_71]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_71]
        at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)
        at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)
        at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)

It seems to me that the implementation is registered twice under two proxies (proxy names
are different at exception throw), which causes the error, apparently.

I have tried the example at home under Windows8 64bits (with admin rights) with no error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message