You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by peter lawrey <pe...@edgeci.com> on 2009/11/04 10:18:35 UTC

Two bundles with the same package.

Hello,
  I have found that having the same package in two bundles, where one
depends on the other causes a problem.  This is ok if the bundles are
independent, but if the same package appears in more than one bundle,
only one bundle will work.
  When I attempt to load the second bundle I get the following error.
However if the second bundle uses a different package, there is no
problem.
  I don't know if this should be an error or not but it could be handled
better, either by reporting the true error or not reporting an error and
working.
  One think I found confusing was the message "Cannot create a POJO
instance, the POJO constructor invocation has thrown an exception :
null"  which indicates that the constructor was called but threw an
unknown exception.  Neither the constructor nor the static block for the
class is called.

See attached for an example.

10:08:26,384 | ERROR | Thread-29        | SamePackage Two
| ?                                   ? | [ERROR] SampleImplementation :
[SampleImplementationA] Class not found during the loading phase :
samepackage.SampleImplementation
10:08:26,385 | ERROR | Thread-29        | SamePackage Two
| ?                                   ? | [ERROR] SampleImplementation :
[SampleImplementationA] createInstance -> The POJO constructor
invocation failed : null
10:08:26,387 | ERROR | Thread-29        | SamePackage Two
| ?                                   ? | [ERROR] SampleImplementation :
Cannot create a POJO instance, the POJO constructor invocation has
thrown an exception : null
java.lang.RuntimeException: Cannot create a POJO instance, the POJO
constructor invocation has thrown an exception : null
        at
org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java
:639)
        at
org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.jav
a:776)
        at
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
ler.__stateChanged(LifecycleCallbackHandler.java:156)
        at
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
ler.stateChanged(LifecycleCallbackHandler.java)
        at
org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:440
)
        at
org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
        at
org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.
java:155)
        at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
.java:298)
        at
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
.java:235)
        at
org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCr
eator.java:360)
        at
org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
89)
        at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
        at
org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
        at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
        at
org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
        at java.lang.Thread.run(Thread.java:619)
10:08:26,387 | ERROR | Thread-29        | SamePackage Two
| ?                                   ? | [ERROR] SampleImplementation :
Cannot create a POJO instance, the POJO constructor invocation has
thrown an exception : null
10:08:26,388 | ERROR | Thread-29        | ipojo
| ?                                   ? | [ERROR] iPOJO Instance Creator
: A matching factory was found for {component=SampleImplementation,
instance.name=SampleImplementationA}, but the instantiation failed : The
configuration is not correct for the type SampleImplementation : Cannot
create a POJO instance, the POJO constructor invocation has thrown an
exception : null


RE: Two bundles with the same package.

Posted by peter lawrey <pe...@edgeci.com>.
When it processes the @Component annotation it can check whether the
class will be loaded, and give an explanation as to why it won't.  It
must at least find/read the annotation as it able to map the name of the
component to the class name (which it later fails to look up)
Given the class will not be loaded perhaps it shouldn't read the
annotation and just reject the bundle at load time. i.e. it kind of half
loads the class which I find a bit odd.

Of course, I think it would be much simpler if the class loading used a
class path approach like the URLCLassLoader does, but I assume there is
a good reason the standard prevents this from happening.
(Obviously karaf needs to follow the standard, so there is not much you
can do about it)

-----Original Message-----
From: Richard S. Hall [mailto:heavy@ungoverned.org] 
Sent: 05 November 2009 14:46
To: users@felix.apache.org
Subject: Re: Two bundles with the same package.

On 11/5/09 4:27, peter lawrey wrote:
> Hello Richard,
>    Thank you for clarifying this.
>    Perhaps the error message can be improved, in situations which work
> under Java but not OSGi. esp. if you are migrating an existing
> application which works. ;)
>    

It would be nice to give a better error message, but it is difficult to 
detect split package situations. What you did is perfectly legal as far 
as the framework is concerned, but the framework interprets differently 
than what you were expecting.

-> richard

> Kind Regards,
>    Peter.
>
> -----Original Message-----
> From: Richard S. Hall [mailto:heavy@ungoverned.org]
> Sent: 04 November 2009 15:24
> To: users@felix.apache.org
> Subject: Re: Two bundles with the same package.
>
>
>
> On 11/4/09 4:18, peter lawrey wrote:
>    
>> Hello,
>>     I have found that having the same package in two bundles, where
one
>> depends on the other causes a problem.  This is ok if the bundles are
>> independent, but if the same package appears in more than one bundle,
>> only one bundle will work.
>>
>>      
> You are creating a split package (i.e., a package spanning multiple
> bundles) then exporting/importing this package from both bundles. This
> sort of thing is specifically not allowed by OSGi, so this is just an
> error in your bundles.
>
> If you import a package from another bundle, it will completely shadow
> an internal package of the same name. See the OSGi spec on class
search
> order. Imports are searched before the bundle class path and they are
> terminal.
>
> By both importing and exporting the package, you are giving the OSGi
> framework the choice to treat the bundle as an importer or an exporter
> (in this case the "or" is "xor"). So, in your scenario, most likely
one
> of your bundles is being selected as an exporter and the other is
being
> selected as an importer.
>
> Moral to the story, don't use split packages.
>
> ->  richard
>
>    
>>     When I attempt to load the second bundle I get the following
error.
>> However if the second bundle uses a different package, there is no
>> problem.
>>     I don't know if this should be an error or not but it could be
>>      
> handled
>    
>> better, either by reporting the true error or not reporting an error
>>      
> and
>    
>> working.
>>     One think I found confusing was the message "Cannot create a POJO
>> instance, the POJO constructor invocation has thrown an exception :
>> null"  which indicates that the constructor was called but threw an
>> unknown exception.  Neither the constructor nor the static block for
>>      
> the
>    
>> class is called.
>>
>> See attached for an example.
>>
>> 10:08:26,384 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR]
SampleImplementation
>>      
> :
>    
>> [SampleImplementationA] Class not found during the loading phase :
>> samepackage.SampleImplementation
>> 10:08:26,385 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR]
SampleImplementation
>>      
> :
>    
>> [SampleImplementationA] createInstance ->   The POJO constructor
>> invocation failed : null
>> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR]
SampleImplementation
>>      
> :
>    
>> Cannot create a POJO instance, the POJO constructor invocation has
>> thrown an exception : null
>> java.lang.RuntimeException: Cannot create a POJO instance, the POJO
>> constructor invocation has thrown an exception : null
>>           at
>>
>>      
>
org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java
>    
>> :639)
>>           at
>>
>>      
>
org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.jav
>    
>> a:776)
>>           at
>>
>>      
>
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
>    
>> ler.__stateChanged(LifecycleCallbackHandler.java:156)
>>           at
>>
>>      
>
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
>    
>> ler.stateChanged(LifecycleCallbackHandler.java)
>>           at
>>
>>      
>
org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:440
>    
>> )
>>           at
>>
org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
>>           at
>>
>>      
>
org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.
>    
>> java:155)
>>           at
>>
>>      
>
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
>    
>> .java:298)
>>           at
>>
>>      
>
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
>    
>> .java:235)
>>           at
>>
>>      
>
org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCr
>    
>> eator.java:360)
>>           at
>>
>>      
>
org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
>    
>> 89)
>>           at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>>           at
>> org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>>           at
>>      
> org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>    
>>           at
>> org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
>>           at java.lang.Thread.run(Thread.java:619)
>> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR]
SampleImplementation
>>      
> :
>    
>> Cannot create a POJO instance, the POJO constructor invocation has
>> thrown an exception : null
>> 10:08:26,388 | ERROR | Thread-29        | ipojo
>> | ?                                   ? | [ERROR] iPOJO Instance
>>      
> Creator
>    
>> : A matching factory was found for {component=SampleImplementation,
>> instance.name=SampleImplementationA}, but the instantiation failed :
>>      
> The
>    
>> configuration is not correct for the type SampleImplementation :
>>      
> Cannot
>    
>> create a POJO instance, the POJO constructor invocation has thrown an
>> exception : null
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>    

---------------------------------------------------------------------
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: Two bundles with the same package.

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 11/5/09 4:27, peter lawrey wrote:
> Hello Richard,
>    Thank you for clarifying this.
>    Perhaps the error message can be improved, in situations which work
> under Java but not OSGi. esp. if you are migrating an existing
> application which works. ;)
>    

It would be nice to give a better error message, but it is difficult to 
detect split package situations. What you did is perfectly legal as far 
as the framework is concerned, but the framework interprets differently 
than what you were expecting.

-> richard

> Kind Regards,
>    Peter.
>
> -----Original Message-----
> From: Richard S. Hall [mailto:heavy@ungoverned.org]
> Sent: 04 November 2009 15:24
> To: users@felix.apache.org
> Subject: Re: Two bundles with the same package.
>
>
>
> On 11/4/09 4:18, peter lawrey wrote:
>    
>> Hello,
>>     I have found that having the same package in two bundles, where one
>> depends on the other causes a problem.  This is ok if the bundles are
>> independent, but if the same package appears in more than one bundle,
>> only one bundle will work.
>>
>>      
> You are creating a split package (i.e., a package spanning multiple
> bundles) then exporting/importing this package from both bundles. This
> sort of thing is specifically not allowed by OSGi, so this is just an
> error in your bundles.
>
> If you import a package from another bundle, it will completely shadow
> an internal package of the same name. See the OSGi spec on class search
> order. Imports are searched before the bundle class path and they are
> terminal.
>
> By both importing and exporting the package, you are giving the OSGi
> framework the choice to treat the bundle as an importer or an exporter
> (in this case the "or" is "xor"). So, in your scenario, most likely one
> of your bundles is being selected as an exporter and the other is being
> selected as an importer.
>
> Moral to the story, don't use split packages.
>
> ->  richard
>
>    
>>     When I attempt to load the second bundle I get the following error.
>> However if the second bundle uses a different package, there is no
>> problem.
>>     I don't know if this should be an error or not but it could be
>>      
> handled
>    
>> better, either by reporting the true error or not reporting an error
>>      
> and
>    
>> working.
>>     One think I found confusing was the message "Cannot create a POJO
>> instance, the POJO constructor invocation has thrown an exception :
>> null"  which indicates that the constructor was called but threw an
>> unknown exception.  Neither the constructor nor the static block for
>>      
> the
>    
>> class is called.
>>
>> See attached for an example.
>>
>> 10:08:26,384 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR] SampleImplementation
>>      
> :
>    
>> [SampleImplementationA] Class not found during the loading phase :
>> samepackage.SampleImplementation
>> 10:08:26,385 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR] SampleImplementation
>>      
> :
>    
>> [SampleImplementationA] createInstance ->   The POJO constructor
>> invocation failed : null
>> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR] SampleImplementation
>>      
> :
>    
>> Cannot create a POJO instance, the POJO constructor invocation has
>> thrown an exception : null
>> java.lang.RuntimeException: Cannot create a POJO instance, the POJO
>> constructor invocation has thrown an exception : null
>>           at
>>
>>      
> org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java
>    
>> :639)
>>           at
>>
>>      
> org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.jav
>    
>> a:776)
>>           at
>>
>>      
> org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
>    
>> ler.__stateChanged(LifecycleCallbackHandler.java:156)
>>           at
>>
>>      
> org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
>    
>> ler.stateChanged(LifecycleCallbackHandler.java)
>>           at
>>
>>      
> org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:440
>    
>> )
>>           at
>> org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
>>           at
>>
>>      
> org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.
>    
>> java:155)
>>           at
>>
>>      
> org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
>    
>> .java:298)
>>           at
>>
>>      
> org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
>    
>> .java:235)
>>           at
>>
>>      
> org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCr
>    
>> eator.java:360)
>>           at
>>
>>      
> org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
>    
>> 89)
>>           at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>>           at
>> org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>>           at
>>      
> org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>    
>>           at
>> org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
>>           at java.lang.Thread.run(Thread.java:619)
>> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
>> | ?                                   ? | [ERROR] SampleImplementation
>>      
> :
>    
>> Cannot create a POJO instance, the POJO constructor invocation has
>> thrown an exception : null
>> 10:08:26,388 | ERROR | Thread-29        | ipojo
>> | ?                                   ? | [ERROR] iPOJO Instance
>>      
> Creator
>    
>> : A matching factory was found for {component=SampleImplementation,
>> instance.name=SampleImplementationA}, but the instantiation failed :
>>      
> The
>    
>> configuration is not correct for the type SampleImplementation :
>>      
> Cannot
>    
>> create a POJO instance, the POJO constructor invocation has thrown an
>> exception : null
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>    

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


RE: Two bundles with the same package.

Posted by peter lawrey <pe...@edgeci.com>.
Hello Richard,
  Thank you for clarifying this.  
  Perhaps the error message can be improved, in situations which work
under Java but not OSGi. esp. if you are migrating an existing
application which works. ;)

Kind Regards,
  Peter.

-----Original Message-----
From: Richard S. Hall [mailto:heavy@ungoverned.org] 
Sent: 04 November 2009 15:24
To: users@felix.apache.org
Subject: Re: Two bundles with the same package.



On 11/4/09 4:18, peter lawrey wrote:
> Hello,
>    I have found that having the same package in two bundles, where one
> depends on the other causes a problem.  This is ok if the bundles are
> independent, but if the same package appears in more than one bundle,
> only one bundle will work.
>    

You are creating a split package (i.e., a package spanning multiple 
bundles) then exporting/importing this package from both bundles. This 
sort of thing is specifically not allowed by OSGi, so this is just an 
error in your bundles.

If you import a package from another bundle, it will completely shadow 
an internal package of the same name. See the OSGi spec on class search 
order. Imports are searched before the bundle class path and they are 
terminal.

By both importing and exporting the package, you are giving the OSGi 
framework the choice to treat the bundle as an importer or an exporter 
(in this case the "or" is "xor"). So, in your scenario, most likely one 
of your bundles is being selected as an exporter and the other is being 
selected as an importer.

Moral to the story, don't use split packages.

-> richard

>    When I attempt to load the second bundle I get the following error.
> However if the second bundle uses a different package, there is no
> problem.
>    I don't know if this should be an error or not but it could be
handled
> better, either by reporting the true error or not reporting an error
and
> working.
>    One think I found confusing was the message "Cannot create a POJO
> instance, the POJO constructor invocation has thrown an exception :
> null"  which indicates that the constructor was called but threw an
> unknown exception.  Neither the constructor nor the static block for
the
> class is called.
>
> See attached for an example.
>
> 10:08:26,384 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation
:
> [SampleImplementationA] Class not found during the loading phase :
> samepackage.SampleImplementation
> 10:08:26,385 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation
:
> [SampleImplementationA] createInstance ->  The POJO constructor
> invocation failed : null
> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation
:
> Cannot create a POJO instance, the POJO constructor invocation has
> thrown an exception : null
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO
> constructor invocation has thrown an exception : null
>          at
>
org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java
> :639)
>          at
>
org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.jav
> a:776)
>          at
>
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
> ler.__stateChanged(LifecycleCallbackHandler.java:156)
>          at
>
org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
> ler.stateChanged(LifecycleCallbackHandler.java)
>          at
>
org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:440
> )
>          at
> org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
>          at
>
org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.
> java:155)
>          at
>
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
> .java:298)
>          at
>
org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
> .java:235)
>          at
>
org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCr
> eator.java:360)
>          at
>
org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
> 89)
>          at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>          at
> org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>          at
org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>          at
> org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
>          at java.lang.Thread.run(Thread.java:619)
> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation
:
> Cannot create a POJO instance, the POJO constructor invocation has
> thrown an exception : null
> 10:08:26,388 | ERROR | Thread-29        | ipojo
> | ?                                   ? | [ERROR] iPOJO Instance
Creator
> : A matching factory was found for {component=SampleImplementation,
> instance.name=SampleImplementationA}, but the instantiation failed :
The
> configuration is not correct for the type SampleImplementation :
Cannot
> create a POJO instance, the POJO constructor invocation has thrown an
> exception : null
>
>    
>
>
>
> ---------------------------------------------------------------------
> 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: Two bundles with the same package.

Posted by "Richard S. Hall" <he...@ungoverned.org>.

On 11/4/09 4:18, peter lawrey wrote:
> Hello,
>    I have found that having the same package in two bundles, where one
> depends on the other causes a problem.  This is ok if the bundles are
> independent, but if the same package appears in more than one bundle,
> only one bundle will work.
>    

You are creating a split package (i.e., a package spanning multiple 
bundles) then exporting/importing this package from both bundles. This 
sort of thing is specifically not allowed by OSGi, so this is just an 
error in your bundles.

If you import a package from another bundle, it will completely shadow 
an internal package of the same name. See the OSGi spec on class search 
order. Imports are searched before the bundle class path and they are 
terminal.

By both importing and exporting the package, you are giving the OSGi 
framework the choice to treat the bundle as an importer or an exporter 
(in this case the "or" is "xor"). So, in your scenario, most likely one 
of your bundles is being selected as an exporter and the other is being 
selected as an importer.

Moral to the story, don't use split packages.

-> richard

>    When I attempt to load the second bundle I get the following error.
> However if the second bundle uses a different package, there is no
> problem.
>    I don't know if this should be an error or not but it could be handled
> better, either by reporting the true error or not reporting an error and
> working.
>    One think I found confusing was the message "Cannot create a POJO
> instance, the POJO constructor invocation has thrown an exception :
> null"  which indicates that the constructor was called but threw an
> unknown exception.  Neither the constructor nor the static block for the
> class is called.
>
> See attached for an example.
>
> 10:08:26,384 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation :
> [SampleImplementationA] Class not found during the loading phase :
> samepackage.SampleImplementation
> 10:08:26,385 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation :
> [SampleImplementationA] createInstance ->  The POJO constructor
> invocation failed : null
> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation :
> Cannot create a POJO instance, the POJO constructor invocation has
> thrown an exception : null
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO
> constructor invocation has thrown an exception : null
>          at
> org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java
> :639)
>          at
> org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.jav
> a:776)
>          at
> org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
> ler.__stateChanged(LifecycleCallbackHandler.java:156)
>          at
> org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHand
> ler.stateChanged(LifecycleCallbackHandler.java)
>          at
> org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:440
> )
>          at
> org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
>          at
> org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.
> java:155)
>          at
> org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
> .java:298)
>          at
> org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory
> .java:235)
>          at
> org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCr
> eator.java:360)
>          at
> org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
> 89)
>          at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>          at
> org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>          at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>          at
> org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
>          at java.lang.Thread.run(Thread.java:619)
> 10:08:26,387 | ERROR | Thread-29        | SamePackage Two
> | ?                                   ? | [ERROR] SampleImplementation :
> Cannot create a POJO instance, the POJO constructor invocation has
> thrown an exception : null
> 10:08:26,388 | ERROR | Thread-29        | ipojo
> | ?                                   ? | [ERROR] iPOJO Instance Creator
> : A matching factory was found for {component=SampleImplementation,
> instance.name=SampleImplementationA}, but the instantiation failed : The
> configuration is not correct for the type SampleImplementation : Cannot
> create a POJO instance, the POJO constructor invocation has thrown an
> exception : null
>
>    
>
>
>
> ---------------------------------------------------------------------
> 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