dev@glassfish.java.net

Re: OSGi Fragment bundle development help

From: PostMasteR <postmaster_at_chaoslayer.de>
Date: Thu, 17 Feb 2011 01:00:14 +0100

On 02/16/2011 03:55 PM, Richard S. Hall wrote:
> On 2/15/11 17:26, PostMasteR wrote:
>> Hi *,
>>
>> I currently have multiple Fragment bundles which I have to maintain.
>> Some times the Fragments just won't attach to their host for some good
>> reason. But there is no way to "inspect" such a fragment bundle to see
>> what is wrong with it, which makes it a pretty time intensive operation
>> to realign a fragment bundle if it changes.
>
> Try setting the Felix framework's log level to 4 (i.e., DEBUG) in
> glassfish3/glassfish/osgi/felix/conf/config.properties. This may give
> you more information as to why the fragment is not attaching. There are
> generally only two reasons why a fragment won't attach:
>
> 1. Its host bundle is already resolved. Felix doesn't support
> attaching fragments to resolved hosts.
> 2. Its dependencies conflict with the host.
>
> If it's the latter, then I think you should see a message logged if you
> enable debug logging.

Well, I already use that on my own machine, but if some other guy at
work does have that problem we would have to restart the framework in
order to reflect that configuration change?

>
>> In addition I already found out by try'n'error that package imports with
>> versions just don't work with Fragment bundles, which is rather
>> counter-productive.
>
> I don't think that's true. Certainly it has been tested. Perhaps you've
> found some bug. If you could create a simple example, you could send it
> to me directly or create an issue over at the Apache Felix project and
> attach it.

OK, I'll try to get some up.

>
>> So, are there any tools or is there some gogo command to see what's
>> going wrong?
>
> If it is not attaching, the only thing you can do is enable debug
> logging and try to resolve the fragment and see if it prints out any
> information.
>
> -> richard
>
>> Thanx,
>>
>> PMR
>