You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by echo_o <ec...@163.com> on 2011/04/02 12:40:28 UTC

Could we check Null when attachFragments in felix-framework-3.20

Hi guys,

After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:

java.lang.NullPointerException
        at java.util.ArrayList.<init>(ArrayList.java:131)
        at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
        at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
        at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
        at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
        at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
        at org.apache.felix.framework.Felix$3.run(Felix.java:876)
        at java.lang.Thread.run(Thread.java:619)

It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.

List<Wire> hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires()); 

It would be better to check whether getWires() return null before using it.  Thank you very much

2011-04-02 



echo_o 

Re: Could we check Null when attachFragments in felix-framework-3.20

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Just to follow up on this, a fix has been committed to trunk:

     https://issues.apache.org/jira/browse/FELIX-2901

It will be included in the next framework release. Thanks again.

-> richard

On 4/2/11 21:35, echo_o wrote:
> I am glad to see that I can do some help.
>
> 2011-04-03
>
>
>
> Huisheng Xu
>
>
>
> 发件人: Richard S. Hall
> 发送时间: 2011-04-03  05:30:42
> 收件人: users
> 抄送:
> 主题: Re: Could we check Null when attachFragments in felix-framework-3.20
>
> Thanks. I'm able to recreate it. I should have a fix in trunk
> shortly...maybe we'll roll a 3.2.1 release since this appears to be easy
> to hit...even though our tests and the CT didn't catch it...
> Thanks for reporting it.
> ->  richard
> On 04/02/2011 03:37 PM, echo_o wrote:
>> Hi Richard,
>>
>>     Thank you for replying so quickly.
>>
>>     If you install fragment bundle before host-bundle, this error will occur when we shutdown the framework.
>>
>>     This exception didn't kill the application, it just display a exception stack message on console.
>>
>>
>> ERROR: Bundle HelloworldImpl [2] Error detaching fragments. (java.lang.NullPointerException)
>> java.lang.NullPointerException
>>           at java.util.ArrayList.<init>(Unknown Source)
>>           at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>>           at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>>           at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>>           at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>>           at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>>           at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>>           at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>>           at java.lang.Thread.run(Unknown Source)
>>
>>
>> 2011-04-03
>>
>>
>>
>> Huisheng Xu
>>
>>
>>
>> 发件人: Richard S. Hall
>> 发送时间: 2011-04-03  01:15:31
>> 收件人: users
>> 抄送:
>> 主题: Re: Could we check Null when attachFragments in felix-framework-3.20
>>
>> Can you tell me how to reproduce this?
>> ->   richard
>> On 04/02/2011 06:40 AM, echo_o wrote:
>>> Hi guys,
>>>
>>> After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:
>>>
>>> java.lang.NullPointerException
>>>            at java.util.ArrayList.<init>(ArrayList.java:131)
>>>            at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>>>            at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>>>            at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>>>            at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>>>            at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>>>            at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>>>            at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>>>            at java.lang.Thread.run(Thread.java:619)
>>>
>>> It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.
>>>
>>> List<Wire>    hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires());
>>>
>>> It would be better to check whether getWires() return null before using it.  Thank you very much
>>>
>>> 2011-04-02
>>>
>>>
>>>
>>> echo_o
>>>
>> ---------------------------------------------------------------------
>> 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: Re: Could we check Null when attachFragments in felix-framework-3.20

Posted by echo_o <ec...@163.com>.
I am glad to see that I can do some help. 

2011-04-03 



Huisheng Xu



发件人: Richard S. Hall 
发送时间: 2011-04-03  05:30:42 
收件人: users 
抄送: 
主题: Re: Could we check Null when attachFragments in felix-framework-3.20 
 
Thanks. I'm able to recreate it. I should have a fix in trunk 
shortly...maybe we'll roll a 3.2.1 release since this appears to be easy 
to hit...even though our tests and the CT didn't catch it...
Thanks for reporting it.
-> richard
On 04/02/2011 03:37 PM, echo_o wrote:
> Hi Richard,
>
>    Thank you for replying so quickly.
>
>    If you install fragment bundle before host-bundle, this error will occur when we shutdown the framework.
>
>    This exception didn't kill the application, it just display a exception stack message on console.
>
>
> ERROR: Bundle HelloworldImpl [2] Error detaching fragments. (java.lang.NullPointerException)
> java.lang.NullPointerException
>          at java.util.ArrayList.<init>(Unknown Source)
>          at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>          at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>          at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>          at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>          at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>          at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>          at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>          at java.lang.Thread.run(Unknown Source)
>
>
> 2011-04-03
>
>
>
> Huisheng Xu
>
>
>
> 发件人: Richard S. Hall
> 发送时间: 2011-04-03  01:15:31
> 收件人: users
> 抄送:
> 主题: Re: Could we check Null when attachFragments in felix-framework-3.20
>
> Can you tell me how to reproduce this?
> ->  richard
> On 04/02/2011 06:40 AM, echo_o wrote:
>> Hi guys,
>>
>> After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:
>>
>> java.lang.NullPointerException
>>           at java.util.ArrayList.<init>(ArrayList.java:131)
>>           at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>>           at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>>           at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>>           at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>>           at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>>           at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>>           at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>>           at java.lang.Thread.run(Thread.java:619)
>>
>> It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.
>>
>> List<Wire>   hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires());
>>
>> It would be better to check whether getWires() return null before using it.  Thank you very much
>>
>> 2011-04-02
>>
>>
>>
>> echo_o
>>
> ---------------------------------------------------------------------
> 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: Could we check Null when attachFragments in felix-framework-3.20

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Thanks. I'm able to recreate it. I should have a fix in trunk 
shortly...maybe we'll roll a 3.2.1 release since this appears to be easy 
to hit...even though our tests and the CT didn't catch it...

Thanks for reporting it.

-> richard

On 04/02/2011 03:37 PM, echo_o wrote:
> Hi Richard,
>
>    Thank you for replying so quickly.
>
>    If you install fragment bundle before host-bundle, this error will occur when we shutdown the framework.
>
>    This exception didn't kill the application, it just display a exception stack message on console.
>
>
> ERROR: Bundle HelloworldImpl [2] Error detaching fragments. (java.lang.NullPointerException)
> java.lang.NullPointerException
>          at java.util.ArrayList.<init>(Unknown Source)
>          at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>          at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>          at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>          at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>          at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>          at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>          at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>          at java.lang.Thread.run(Unknown Source)
>
>
> 2011-04-03
>
>
>
> Huisheng Xu
>
>
>
> 发件人: Richard S. Hall
> 发送时间: 2011-04-03  01:15:31
> 收件人: users
> 抄送:
> 主题: Re: Could we check Null when attachFragments in felix-framework-3.20
>
> Can you tell me how to reproduce this?
> ->  richard
> On 04/02/2011 06:40 AM, echo_o wrote:
>> Hi guys,
>>
>> After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:
>>
>> java.lang.NullPointerException
>>           at java.util.ArrayList.<init>(ArrayList.java:131)
>>           at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>>           at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>>           at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>>           at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>>           at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>>           at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>>           at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>>           at java.lang.Thread.run(Thread.java:619)
>>
>> It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.
>>
>> List<Wire>   hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires());
>>
>> It would be better to check whether getWires() return null before using it.  Thank you very much
>>
>> 2011-04-02
>>
>>
>>
>> echo_o
>>
> ---------------------------------------------------------------------
> 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: Re: Could we check Null when attachFragments in felix-framework-3.20

Posted by echo_o <ec...@163.com>.
Hi Richard,

  Thank you for replying so quickly.

  If you install fragment bundle before host-bundle, this error will occur when we shutdown the framework.

  This exception didn't kill the application, it just display a exception stack message on console.


ERROR: Bundle HelloworldImpl [2] Error detaching fragments. (java.lang.NullPointerException)
java.lang.NullPointerException
        at java.util.ArrayList.<init>(Unknown Source)
        at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
        at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
        at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
        at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
        at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
        at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
        at org.apache.felix.framework.Felix$3.run(Felix.java:876)
        at java.lang.Thread.run(Unknown Source)


2011-04-03 



Huisheng Xu



发件人: Richard S. Hall 
发送时间: 2011-04-03  01:15:31 
收件人: users 
抄送: 
主题: Re: Could we check Null when attachFragments in felix-framework-3.20 
 
Can you tell me how to reproduce this?
-> richard
On 04/02/2011 06:40 AM, echo_o wrote:
> Hi guys,
>
> After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:
>
> java.lang.NullPointerException
>          at java.util.ArrayList.<init>(ArrayList.java:131)
>          at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>          at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>          at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>          at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>          at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>          at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>          at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>          at java.lang.Thread.run(Thread.java:619)
>
> It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.
>
> List<Wire>  hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires());
>
> It would be better to check whether getWires() return null before using it.  Thank you very much
>
> 2011-04-02
>
>
>
> echo_o
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

Re: Could we check Null when attachFragments in felix-framework-3.20

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Can you tell me how to reproduce this?

-> richard

On 04/02/2011 06:40 AM, echo_o wrote:
> Hi guys,
>
> After I upgrade felix framework from 3.0.9 to 3.2.0,  I met an error like this:
>
> java.lang.NullPointerException
>          at java.util.ArrayList.<init>(ArrayList.java:131)
>          at org.apache.felix.framework.ModuleImpl.attachFragments(ModuleImpl.java:1183)
>          at org.apache.felix.framework.BundleImpl.closeModules(BundleImpl.java:138)
>          at org.apache.felix.framework.BundleImpl.close(BundleImpl.java:101)
>          at org.apache.felix.framework.Felix$SystemBundleActivator.stop(Felix.java:4593)
>          at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:651)
>          at org.apache.felix.framework.Felix.stopBundle(Felix.java:2226)
>          at org.apache.felix.framework.Felix$3.run(Felix.java:876)
>          at java.lang.Thread.run(Thread.java:619)
>
> It seems that there is no Null checking when felix close a Module with fragments.  Here is the codes from ModuleImpl.java, line 1183.
>
> List<Wire>  hostWires = new ArrayList<Wire>(m_fragments.get(i).getWires());
>
> It would be better to check whether getWires() return null before using it.  Thank you very much
>
> 2011-04-02
>
>
>
> echo_o
>

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