MRP: ScreenRenderException

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

MRP: ScreenRenderException

Guido Amarilla
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
Reply | Threaded
Open this post in threaded view
|

Re: MRP: ScreenRenderException

Jacopo Cappellato
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
>

Reply | Threaded
Open this post in threaded view
|

Re: MRP: ScreenRenderException

Guido Amarilla
Thank YOU for fixing it so fast  ;)

2007/10/29, Jacopo Cappellato <[hidden email]>:

>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: MRP: ScreenRenderException

David E Jones
In reply to this post by Jacopo Cappellato

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


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MRP: ScreenRenderException

Jacopo Cappellato
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
Reply | Threaded
Open this post in threaded view
|

Re: MRP: ScreenRenderException

David E Jones

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


smime.p7s (3K) Download Attachment