felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "swapnesh.patel" <sapan_0...@yahoo.com>
Subject Re: Bug in bundlerepository-2.0.4 ?
Date Sat, 30 May 2015 00:57:27 GMT
I am trying to run deploy -s "BundleName" command and i am seeing same error.

As per the document it says that if bundle is already installed then it
tries to update else install. But i see same exception whenever it tries to
go to "update" bundle.

I tried to debug into it. Following function "findUpdatableLocalResource" in
ResolverImpl class tries to cast localResources[i] into LocalResourceImpl
and that's when it is not able to cast instance of LazyLocalResourceImpl
object into  LocalResourceImpl object. LazyLocalResourceImpl is derived from
Resource class and not the LocalResourceImpl class.

I tried to see why my bundle was installed as LazyLocalResourceImpl and i
found that "addBundle" method of LocalRepositoryImpl class by default adds
bundle as LazyLocalResourceImpl instead of LocalResourceImpl.

I believe there is a bug somewhere in below function that does not handle
different between LocalResourceImpl and LazyLocalResourceImpl.


 // TODO: OBR - Think about this again and make sure that deployment
ordering
    // won't impact it...we need to update the local state too.
    private LocalResourceImpl findUpdatableLocalResource(Resource resource)
    {
        // Determine if any other versions of the specified resource
        // already installed.
        Resource[] localResources =
findLocalResources(resource.getSymbolicName());
        if (localResources != null)
        {
            // Since there are local resources with the same symbolic
            // name installed, then we must determine if we can
            // update an existing resource or if we must install
            // another one. Loop through all local resources with same
            // symbolic name and find the first one that can be updated
            // without breaking constraints of existing local resources.
            for (int i = 0; i < localResources.length; i++)
            {
                if (isResourceUpdatable(localResources[i], resource,
localResources))
                {
                    return (LocalResourceImpl) localResources[i];
                }
            }
        }
        return null;
    }



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Bug-in-bundlerepository-2-0-4-tp5012912p5013088.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message