Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
blueprint-core-0.4.1
-
None
-
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:]
Attachments
Issue Links
- is related to
-
KARAF-1553 Command service references should be AUTO_EXPORT_INTERFACES
- Resolved
- relates to
-
KARAF-1209 ServiceRecipe blueprint exception in the log
- Resolved
-
KARAF-1547 NullpointerException when running commands on jdk 6 update 33 or jdk 7 update 5
- Closed