You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Guido Amarilla <ga...@gmail.com> on 2007/10/29 18:08:20 UTC

MRP: ScreenRenderException

I'm getting this error:

org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
[component://manufacturing/widget/manufacturing/MrpScreens.xml#FindMrpPlannedEvents]:
java.lang.NullPointerException (null)

It is reproducible in this demo server:

https://demo.hotwaxmedia.com/manufacturing/control/FindInventoryEventPlan

What's the status of this component?
Should I post a "bug" issue to Jira or is this some kind of configuration
error?


Regards

-- 
Guido Amarilla

Re: MRP: ScreenRenderException

Posted by David E Jones <jo...@hotwaxmedia.com>.
On Oct 29, 2007, at 1:56 PM, Jacopo Cappellato wrote:

> David E Jones wrote:
>> On Oct 29, 2007, at 11:47 AM, Jacopo Cappellato wrote:
>>> the bug is fixed in rev. 589769
>>> It was caused by old code not working well after the very recent  
>>> framework updates.
>> I looked at your commit on this and am wondering what the framework  
>> update was that caused this problem, mainly because it might cause  
>> similar problems in other places... It might be something we want  
>> to add some code to in order to keep it backward compatible.
>> -David
>
> The offending instructions were in the screen action:
>
> <set field="lastFinishedJob" from-field="mrpFinishedJobs[0]"/>
> <set field="lastFinishedJobs[]" from-field="lastFinishedJob"/>
>
> If mrpFinishedJobs is empty or null then also lastFinishedJob is  
> null and so in the second line a null value is inserted into the list.
>
> In the old framework this seemed to work fine: the lastFinishedJobs  
> list was empty and so no rows were shown in the list form.
> In the new framework, I guess, lastFinishedJobs was filled with a  
> null object and this was causing a NPE...
>
> Does it make sense?
>
> However it is easy to recreate...

This is an interesting issue... I'm wondering when this changed. The  
NPE probably comes from trying to put it into a FastList, which  
doesn't allow null entries.

I'm thinking of a couple of improvements:

1. in the FlexibleMapAccessor check for nulls before adding to list  
and just not do it

2. add the set-if-null and set-if-empty attributes to the screen  
action set just like the simple-method set operation, with the same  
defaults (false for null, true for empty)

I think I'll do #1, or look into it, right away. That way at least  
adding to a list won't blow up (which is silly).

-David


Re: MRP: ScreenRenderException

Posted by Jacopo Cappellato <ti...@sastau.it>.
David E Jones wrote:
> 
> On Oct 29, 2007, at 11:47 AM, Jacopo Cappellato wrote:
> 
>> the bug is fixed in rev. 589769
>> It was caused by old code not working well after the very recent 
>> framework updates.
> 
> I looked at your commit on this and am wondering what the framework 
> update was that caused this problem, mainly because it might cause 
> similar problems in other places... It might be something we want to add 
> some code to in order to keep it backward compatible.
> 
> -David
> 

The offending instructions were in the screen action:

<set field="lastFinishedJob" from-field="mrpFinishedJobs[0]"/>
<set field="lastFinishedJobs[]" from-field="lastFinishedJob"/>

If mrpFinishedJobs is empty or null then also lastFinishedJob is null 
and so in the second line a null value is inserted into the list.

In the old framework this seemed to work fine: the lastFinishedJobs list 
was empty and so no rows were shown in the list form.
In the new framework, I guess, lastFinishedJobs was filled with a null 
object and this was causing a NPE...

Does it make sense?

However it is easy to recreate...

Jacopo

Re: MRP: ScreenRenderException

Posted by David E Jones <jo...@hotwaxmedia.com>.
On Oct 29, 2007, at 11:47 AM, Jacopo Cappellato wrote:

> the bug is fixed in rev. 589769
> It was caused by old code not working well after the very recent  
> framework updates.

I looked at your commit on this and am wondering what the framework  
update was that caused this problem, mainly because it might cause  
similar problems in other places... It might be something we want to  
add some code to in order to keep it backward compatible.

-David


Re: MRP: ScreenRenderException

Posted by Guido Amarilla <ga...@gmail.com>.
Thank YOU for fixing it so fast  ;)

2007/10/29, Jacopo Cappellato <ti...@sastau.it>:
>
> Thanks Guido,
>
> the bug is fixed in rev. 589769
> It was caused by old code not working well after the very recent
> framework updates.
>
> Thanks for the bug report.
>
> Jacopo
>
>
> Guido Amarilla wrote:
> > I'm getting this error:
> >
> > org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
> >
> [component://manufacturing/widget/manufacturing/MrpScreens.xml#FindMrpPlannedEvents]:
> > java.lang.NullPointerException (null)
> >
> > It is reproducible in this demo server:
> >
> >
> https://demo.hotwaxmedia.com/manufacturing/control/FindInventoryEventPlan
> >
> > What's the status of this component?
> > Should I post a "bug" issue to Jira or is this some kind of
> configuration
> > error?
> >
> >
> > Regards
> >
>
>


-- 
Guido Amarilla

Re: MRP: ScreenRenderException

Posted by Jacopo Cappellato <ti...@sastau.it>.
Thanks Guido,

the bug is fixed in rev. 589769
It was caused by old code not working well after the very recent 
framework updates.

Thanks for the bug report.

Jacopo


Guido Amarilla wrote:
> I'm getting this error:
> 
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
> [component://manufacturing/widget/manufacturing/MrpScreens.xml#FindMrpPlannedEvents]:
> java.lang.NullPointerException (null)
> 
> It is reproducible in this demo server:
> 
> https://demo.hotwaxmedia.com/manufacturing/control/FindInventoryEventPlan
> 
> What's the status of this component?
> Should I post a "bug" issue to Jira or is this some kind of configuration
> error?
> 
> 
> Regards
>