You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Jean-Baptiste Onofré (Created JIRA)" <ji...@apache.org> on 2012/02/29 14:57:57 UTC

[jira] [Created] (ARIES-835) Proxy generation use the bean instead of the interface

Proxy generation use the bean instead of the interface
------------------------------------------------------

                 Key: ARIES-835
                 URL: https://issues.apache.org/jira/browse/ARIES-835
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
    Affects Versions: blueprint-core-0.4.1
            Reporter: Jean-Baptiste Onofré


In Karaf, we have a BlueprintCommand class looking like:

public class BlueprintCommand extends AbstractCommand implements CompletableFunction

where AbstractCommand implements Function:

public abstract class AbstractCommand implements Function

We expose this as a service with the following blueprint definition:

    <service>
        <interfaces>
            <value>org.apache.felix.service.command.Function</value>
            <value>org.apache.karaf.shell.console.CompletableFunction</value>
        </interfaces>
        <service-properties>
            <entry key="osgi.command.scope" value="*"/>
            <entry key="osgi.command.function" value="help"/>
        </service-properties>
        <bean class="org.apache.karaf.shell.console.commands.BlueprintCommand">
            <property name="blueprintContainer" ref="blueprintContainer"/>
            <property name="blueprintConverter" ref="blueprintConverter"/>
            <property name="actionId" value="help"/>
        </bean>
    </service>

So Aries Blueprint should generate a proxy with Function and CompletableFunction.

However, it seems that Aries tries to generate a proxy with BlueprintCommand, which is not correct:

2012-02-29 14:33:26,076 | INFO  | l Console Thread | ServiceRecipe                    | viceRecipe$TriggerServiceFactory  534 | 17 - org.apache.aries.blueprint.core - 0.4.1.SNAPSHOT | Unable to create a proxy object for the service shell-162 defined in bundle org.apache.karaf.shell.log at version 3.0.0.SNAPSHOT with id 61. Returning the original object instead.
org.apache.aries.proxy.UnableToProxyException: The class org.apache.karaf.shell.console.commands.BlueprintCommand is not an interface and therefore a proxy cannot be generated.
        at org.apache.aries.proxy.impl.JdkProxyManager.getInterfaces(JdkProxyManager.java:43)[16:org.apache.aries.proxy.impl:0.4.1.SNAPSHOT]
        at org.apache.aries.proxy.impl.JdkProxyManager.createNewProxy(JdkProxyManager.java:36)[16:org.apache.aries.proxy.impl:0.4.1.SNAPSHOT]
        at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)[16:org.apache.aries.proxy.impl:0.4.1.SNAPSHOT]
        at org.apache.aries.proxy.impl.AbstractProxyManager.createInterceptingProxy(AbstractProxyManager.java:53)[16:org.apache.aries.proxy.impl:0.4.1.SNAPSHOT]
        at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:530)[17:org.apache.aries.blueprint.core:0.4.1.SNAPSHOT]
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.2.jar:]
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.2.jar:]


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira