Aries
  1. Aries
  2. ARIES-835

Proxy generation use the bean instead of the interface

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: blueprint-core-0.4.1
    • Fix Version/s: None
    • Component/s: Blueprint
    • Labels:
      None

      Description

      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:]

        Issue Links

          Activity

          Hide
          Daniel Kulp added a comment -


          I believe KARAF-1553 is really the cause of this. The above service definition is defining the "help" command, but the stack trace shows the "log" commands which would be loaded via the mechanism in KARAF-1553.

          Show
          Daniel Kulp added a comment - I believe KARAF-1553 is really the cause of this. The above service definition is defining the "help" command, but the stack trace shows the "log" commands which would be loaded via the mechanism in KARAF-1553 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Jean-Baptiste Onofré
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development