Details
Description
UnableToProxyException arises with Karaf 2.3.0/Aries 1.0.0 when install a blueprint based bundle into container.
Caused by: org.apache.aries.proxy.UnableToProxyException: The class xxx.xxx.SomeClass is not an interface and therefore a proxy cannot be generated.
at org.apache.aries.proxy.impl.JdkProxyManager.getInterfaces(JdkProxyManager.java:43)
at org.apache.aries.proxy.impl.JdkProxyManager.createNewProxy(JdkProxyManager.java:36)
at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)
at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:40)
at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:299)
at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:102)
... 56 more
The blueprint configuration in the bundle:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
...
<reference
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
ext:proxy-method="classes" id="SomeFeature" interface="xxx.xxx.SomeClass"/>
...
</blueprint>
The stack shows that the JDK proxy (JdkProxyManager) used instead of AsmProxyManager,
even though ASM 4.0 installed in container:
karaf@admin> exports | grep asm
107 org.springframework.asm; version="3.0.7.RELEASE"
107 org.springframework.asm.commons; version="3.0.7.RELEASE"
107 org.springframework.asm.signature; version="3.0.7.RELEASE"
113 net.sf.cglib.asm; version="2.2.2"
113 net.sf.cglib.asm.signature; version="2.2.2"
212 org.objectweb.asm; version="4.0.0"
212 org.objectweb.asm.signature; version="4.0.0"
212 org.objectweb.asm.commons; version="4.0.0"
212 org.objectweb.asm.tree; version="4.0.0"
212 org.objectweb.asm.tree.analysis; version="4.0.0"
212 org.objectweb.asm.util; version="4.0.0"
212 org.objectweb.asm.xml; version="4.0.0"