You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Borja Miñano <bm...@iac3.eu> on 2009/06/29 15:33:01 UTC

File Install dependency problem

Hi, 

I have a problem using file install deploying some bundles.
I have a bundle A that imports the package "org.xmldb.api.base", and a
bundle B that exports the same package.
The file install installs the both bundles correctly, but when it tries
to start bundle A a class not found exception for a class inside the
package.

It is very strange because if i install the bundles manually the bundle
A works perfectly. But i need to make the deploy automatically with file
install or something similar.

I hope someone could help me


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


Re: File Install dependency problem

Posted by Borja Miñano <bm...@iac3.eu>.
Hi,

In fact the inconsistency was the following:

Bundle A:
Export-Package: org.foo (Class A)

Bundle B:
Export-Package: org.foo (Class A)

Bundle C:
Import-Package: org.foo

Bundles A and B exports the same package that contains the same class.
When i was testing i saw that the order of installation affected me, but
in OSGI the order doesn't have to affect. So this confused me until i
found the problem. 

El mar, 30-06-2009 a las 13:36 +0100, Neil Bartlett escribió:
> Hi Filippo,
> 
> I'm aware of that, but suppose you have the following situation (based
> on the fact stated by Borja that there are two bundles exporting the
> same package):
> 
> Bundle A:
> Export-Package: org.foo (contains class Wibble, used by org.bar.Wobble)
> Import-Package: org.foo
> 
> Bundle B:
> Export-Package org.foo (does NOT contain class Wibble)
> Import-Package: org.foo
> 
> If A is installed and resolved first, then the class org.foo.Wibble
> will be accessible to org.bar.Wobble because the framework will choose
> to export package org.foo from A rather than import it. If B is
> installed and resolved first, then the framework will export org.foo
> from B and import it into A, so the class org.bar.Wobble will not be
> able to access org.foo.Wibble.
> 
> It is incorrect to construct bundles this way, but it may explain why
> Borja received an error using FileInstall but not when manually
> installing in a certain order.
> 
> Regards
> Neil
> 
> On Tue, Jun 30, 2009 at 1:27 PM, Filippo
> Diotalevi<fi...@gmail.com> wrote:
> > On Tue, Jun 30, 2009 at 2:16 PM, Neil Bartlett<nj...@gmail.com> wrote:
> >> This may be due to the order in which you installed the bundles. If
> >> you have got errors in your metadata then the problem might not appear
> >> if you always install your bundles in the same order, but installation
> >> order with FileInstall is not controllable (nor should it be).
> >
> > In FI all the discovered bundles are installed first, and then started.
> >
> > So when a bundle starts, all the exported packages from all the
> > discovered bundles are already available.
> >
> > --
> > Filippo Diotalevi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


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


Re: File Install dependency problem

Posted by Neil Bartlett <nj...@gmail.com>.
Hi Filippo,

I'm aware of that, but suppose you have the following situation (based
on the fact stated by Borja that there are two bundles exporting the
same package):

Bundle A:
Export-Package: org.foo (contains class Wibble, used by org.bar.Wobble)
Import-Package: org.foo

Bundle B:
Export-Package org.foo (does NOT contain class Wibble)
Import-Package: org.foo

If A is installed and resolved first, then the class org.foo.Wibble
will be accessible to org.bar.Wobble because the framework will choose
to export package org.foo from A rather than import it. If B is
installed and resolved first, then the framework will export org.foo
from B and import it into A, so the class org.bar.Wobble will not be
able to access org.foo.Wibble.

It is incorrect to construct bundles this way, but it may explain why
Borja received an error using FileInstall but not when manually
installing in a certain order.

Regards
Neil

On Tue, Jun 30, 2009 at 1:27 PM, Filippo
Diotalevi<fi...@gmail.com> wrote:
> On Tue, Jun 30, 2009 at 2:16 PM, Neil Bartlett<nj...@gmail.com> wrote:
>> This may be due to the order in which you installed the bundles. If
>> you have got errors in your metadata then the problem might not appear
>> if you always install your bundles in the same order, but installation
>> order with FileInstall is not controllable (nor should it be).
>
> In FI all the discovered bundles are installed first, and then started.
>
> So when a bundle starts, all the exported packages from all the
> discovered bundles are already available.
>
> --
> Filippo Diotalevi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

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


Re: File Install dependency problem

Posted by Filippo Diotalevi <fi...@gmail.com>.
On Tue, Jun 30, 2009 at 2:16 PM, Neil Bartlett<nj...@gmail.com> wrote:
> This may be due to the order in which you installed the bundles. If
> you have got errors in your metadata then the problem might not appear
> if you always install your bundles in the same order, but installation
> order with FileInstall is not controllable (nor should it be).

In FI all the discovered bundles are installed first, and then started.

So when a bundle starts, all the exported packages from all the
discovered bundles are already available.

-- 
Filippo Diotalevi

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


Re: File Install dependency problem

Posted by Neil Bartlett <nj...@gmail.com>.
This may be due to the order in which you installed the bundles. If
you have got errors in your metadata then the problem might not appear
if you always install your bundles in the same order, but installation
order with FileInstall is not controllable (nor should it be).

Regards,
Neil

On Tue, Jun 30, 2009 at 12:08 PM, Borja Miñano<bm...@iac3.eu> wrote:
> Hi Filippo,
>
> Thank you for the interest.
> I've been doing some tests and i found the error.
>
> I used external libraries that i bundlelized with the eclipse plugin and
> 2 of these libraries exported the same package with the same class.
> I quit the export from one of these bundles and worked.
>
> But i still don't know why worked if i install it manually and don't if
> file install is the installer.
>
> Thank you anyway.
>
> El mar, 30-06-2009 a las 11:12 +0200, Filippo Diotalevi escribió:
>> On Mon, Jun 29, 2009 at 3:33 PM, Borja Miñano<bm...@iac3.eu> wrote:
>> > Hi,
>> > I have a problem using file install deploying some bundles.
>> > I have a bundle A that imports the package "org.xmldb.api.base", and a
>> > bundle B that exports the same package.
>> > The file install installs the both bundles correctly, but when it tries
>> > to start bundle A a class not found exception for a class inside the
>> > package.
>> >
>> > It is very strange because if i install the bundles manually the bundle
>> > A works perfectly. But i need to make the deploy automatically with file
>> > install or something similar.
>>
>> Hi,
>>   unfortunately the details you're providing aren't enough to give you
>> an answer.
>>
>> FileInstall just calls the usual BundleContext and Bundle methods to
>> install, start, stop and uninstall bundles; so, implementation-wise,
>> it's absolutely equivalent to the shell.
>>
>> I suggest you to check your setup, and try to reproduce the error with
>> the minimal set of bundles possible.
>> If the problem persist, please post here the list of bundles
>> installed, with import and exports, and the exception you get.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

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


Re: File Install dependency problem

Posted by Borja Miñano <bm...@iac3.eu>.
Hi Filippo,

Thank you for the interest.
I've been doing some tests and i found the error.

I used external libraries that i bundlelized with the eclipse plugin and
2 of these libraries exported the same package with the same class.
I quit the export from one of these bundles and worked.

But i still don't know why worked if i install it manually and don't if
file install is the installer.

Thank you anyway.

El mar, 30-06-2009 a las 11:12 +0200, Filippo Diotalevi escribió:
> On Mon, Jun 29, 2009 at 3:33 PM, Borja Miñano<bm...@iac3.eu> wrote:
> > Hi,
> > I have a problem using file install deploying some bundles.
> > I have a bundle A that imports the package "org.xmldb.api.base", and a
> > bundle B that exports the same package.
> > The file install installs the both bundles correctly, but when it tries
> > to start bundle A a class not found exception for a class inside the
> > package.
> >
> > It is very strange because if i install the bundles manually the bundle
> > A works perfectly. But i need to make the deploy automatically with file
> > install or something similar.
> 
> Hi,
>   unfortunately the details you're providing aren't enough to give you
> an answer.
> 
> FileInstall just calls the usual BundleContext and Bundle methods to
> install, start, stop and uninstall bundles; so, implementation-wise,
> it's absolutely equivalent to the shell.
> 
> I suggest you to check your setup, and try to reproduce the error with
> the minimal set of bundles possible.
> If the problem persist, please post here the list of bundles
> installed, with import and exports, and the exception you get.
> 


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


Re: File Install dependency problem

Posted by Filippo Diotalevi <fi...@gmail.com>.
On Mon, Jun 29, 2009 at 3:33 PM, Borja Miñano<bm...@iac3.eu> wrote:
> Hi,
> I have a problem using file install deploying some bundles.
> I have a bundle A that imports the package "org.xmldb.api.base", and a
> bundle B that exports the same package.
> The file install installs the both bundles correctly, but when it tries
> to start bundle A a class not found exception for a class inside the
> package.
>
> It is very strange because if i install the bundles manually the bundle
> A works perfectly. But i need to make the deploy automatically with file
> install or something similar.

Hi,
  unfortunately the details you're providing aren't enough to give you
an answer.

FileInstall just calls the usual BundleContext and Bundle methods to
install, start, stop and uninstall bundles; so, implementation-wise,
it's absolutely equivalent to the shell.

I suggest you to check your setup, and try to reproduce the error with
the minimal set of bundles possible.
If the problem persist, please post here the list of bundles
installed, with import and exports, and the exception you get.

-- 
Filippo Diotalevi

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