Ivan,

Please keep in mind when working on the web application support
(servlet 3.0, etc.) it should support two types of applications:
regular Java EE applications and OSGi web applications.
The OSGi web applications support fragment bundles. That is, the
content of a OSGi web application is looked up in the bundle itself
and as well any attached fragments. That means, the entry.getBundle()
based lookup is not enough as it does not consider the fragment
bundles. That's also why I added BundleUtils.getEntry() and
BundleUtils.getEntryPaths() utility functions which work like
Bundle.getEntry() and Bundle.getEntryPaths() but also consider the
fragment bundles. Please make sure to use those functions.

The fragment bundles are another reason why we can't really use the
configurationBaseUrl since there is no single root url through which
we can access both the bundle contents and its attached fragments.

Jarek

On Wed, May 19, 2010 at 2:34 AM, Ivan <[email protected]> wrote:
> Yes, embbed jar files should not work due to different url with the host
> bundle, I forgot it ...
> OK, I would try to replace them with getEntry methods. Thanks !
>
> 2010/5/19 David Jencks <[email protected]>
>>
>> On May 18, 2010, at 10:54 PM, Ivan wrote:
>>
>> > Hi,
>> >     In the past, we have a magic attribute configurationBaseUrl which
>> > will be injected while starting the gbeans. After moving to OSGI
>> > environment, it is removed as all the components are running in OSGI cache.
>> > While looking at some web service codes, it is still refered in many
>> > places. And in the new OSGi environment, it should be replaced with
>> > something like bundle.getEntry etc. But before doing those changes, I am
>> > thinking to recover the configurationBaseUrl attribute temporary, using
>> > -->
>> > URL baseURL = configuration.getBundle().getEntry("/");
>> > gbeanData.setAttribute("configurationBaseUrl", baseURL);
>> > <---
>> > In my environment, it works.
>> > Any thought ?
>>
>> I don't think it will work for a module embedded in an ear.  The uses I
>> changed were all for wars and needed it to point to the directory in the
>> unpacked car file the war was at.
>>
>> What will bringing this attribute back allow you to do that you can't do
>> locally and eliminate before committing?
>>
>> thanks
>> david jencks
>>
>> >
>> > --
>> > Ivan
>>
>
>
>
> --
> Ivan
>

Reply via email to