That's not the way it works in OSGi.  This is true for services, not so much
for packages.  There are ways to improve that by using a
DynamicImport-Package though ...
Anyway, I think we should use asm instead of cglib for proxying, as it's
done for interceptors.  We get then get rid of cglib and only depend on asm
when needed.  All the code is already available afaik.


On Sun, Sep 26, 2010 at 03:48, Bengt Rodehav <[email protected]> wrote:

> That will work but I regard this as a bug in Blueprint. A well behaved OSGi
> citizen should keep track of dependencies coming and going. It shouldn't
> matter if cglib was not present when Blueprint was started as long as its
> there when it's needed (in this case when creating my blueprint container
> that requires interceptors).
>
> Should I create a JIRA for this?
>
> /Bengt
>
> 2010/9/25 Guillaume Nodet <[email protected]>
>
> Try to restart or osgi:refresh the blueprint bundle in case the wiring
>> hasn't been correctly done.
>>
>>
>> On Sat, Sep 25, 2010 at 18:11, Bengt Rodehav <[email protected]> wrote:
>>
>>> It seems like the Aries Blueprint bundle requires cglib (or asm) to be
>>> installed before Blueprint is activated. If I first install Blueprint, then
>>> cglib and then my bundle requiring transaction interceptors it fails with
>>> with following exception:
>>>
>>> 2010-09-25 18:10:24,998 | ERROR | rint Extender: 2 |
>>>> BlueprintContainerImpl           | container.BlueprintContainerImpl  342 |
>>>> Unable to start blueprint container for bundle refdata
>>>
>>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>>>> Interceptors have been configured but neither asm nor cglib are available
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:694)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:748)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:624)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:315)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:213)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  at
>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_18]
>>>
>>>  at
>>>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_18]
>>>
>>>  at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_18]
>>>
>>>  at
>>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_18]
>>>
>>>  at
>>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)[:1.6.0_18]
>>>
>>>  at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_18]
>>>
>>>  at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_18]
>>>
>>>  at java.lang.Thread.run(Thread.java:619)[:1.6.0_18]
>>>
>>> Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer
>>>
>>>  at
>>>> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)[org.apache.felix.framework-3.0.2.jar:]
>>>
>>>  at
>>>> org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)[org.apache.felix.framework-3.0.2.jar:]
>>>
>>>  at
>>>> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)[org.apache.felix.framework-3.0.2.jar:]
>>>
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_18]
>>>
>>>  at
>>>> org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:691)[7:org.apache.aries.blueprint:0.2.0.incubating]
>>>
>>>  ... 15 more
>>>
>>>
>>>
>>> If I make sure that cglib is started before Blueprint then everything
>>> works. Shouldn't it be enough that cglib is installed by the time I install
>>> my bundle requiring interceptors. Blueprint should pick up cglib when it is
>>> installed even if it happens after Blueprint itself is started.
>>>
>>> I use Karaf 2.1, Aries 0.2-incubating and the Servicemix packaging of
>>> cglib version 2.1_3_4.
>>>
>>> /Bengt
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>>
>>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply via email to