Yes, that was my diagnosis. The line you referenced, is from the If
component, part of the Tapestry distribution.

Yes, I agree there's something wrong here, obviously, the reason for
including my code, was to point out that it's nothing exotic, but basic
boolean (small b, not Boolean) logic. As a result, because the one object
object dereference is protected by the if statement, should never throw an
exception. My point being that getDocHasFundCites() will always return a
Valid value. 

This code runs correctly, about 98% of the time...

What I'm looking for more than anything else is advice about how to diagnose
this problem, either by looking at the exception page, or by adding code to
aid in diagnosis. 

Adding the names to the components is probably a good idea, and I'll get
that put in place ASAP.


Tony


On 3/10/09 10:53 PM, "Andreas Andreou" <[email protected]> wrote:

> Probably
> Object valueObject = getDataSqueezer().unsqueeze(submittedValue);
> returns null
> 
> That hidden value that you mention (If_16_0), is it always with no value?
> or just only when the exception is thrown?
> 
> BTW, you can give names to your If components so that's it's easier to track
> which is which - something like <span jwcid="ifcit...@if" ...>
> 
> So, I was thinking perhaps getDocHasFundCites() encounters problems
> while rendering
> in those random cases, but you'd get excpetions if that was the case...
> 
> 
> On Tue, Mar 10, 2009 at 10:51 PM, Tony Giaccone <[email protected]> wrote:
>> it was mentioned to me that I hadn't mentioned in my earlier post that this
>> was a Tapestry 4.1.5 problem.
>> 
>> Also further diagnosis shows that there seems to be a problem with the @IF
>> component.
>> 
>> Here's the code the If is bound to:
>> 
>>    public boolean getDocHasFundCites()
>>    {
>>        boolean retValue= false;
>>        if (getDetailFD() != null)
>>        {
>>            retValue = (getDetailFD().getFundCites() != null) &&
>>                        (getDetailFD().getFundCites().size() > 0);
>>        }
>>        return (retValue);
>>    }
>> 
>> 
>> In the page from the exception there's the HttpServletRequest  stanza,
>> 
>> among the many IF statements that are called out, well here I'll just copy
>> the significant lines.
>> 
>> If_14_0 T
>> If_15_0 T
>> If_16_0
>> If_18   F
>> If_1_0  F
>> If_20   F
>> If_22   T
>> 
>> Notice on the line that start If_16_0, there is no boolean value, no T or F.
>> 
>> 
>> I'm guessing that is what's causing this exception:
>> 
>> [ +/- ] Exception: Unable to convert back into a boolean in If component. <
>> https://mipr-dev/mipr/MiprDetail,miprForm.sdirect#>
>> org.apache.hivemind.ApplicationRuntimeException
>> Stack Trace:
>> org.apache.tapestry.components.IfBean.readValue(IfBean.java:184)
>> org.apache.tapestry.components.IfBean.evaluateCondition(IfBean.java:143)
>> org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:66)
>> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:724)
>> 
>> 
>> This code works the vast majority of the time. These exceptions seem to be
>> thrown "randomly". Of course I'm sure that it's not
>> random, I just don't know what set of circumstances cause it to occur.
>> Here's the code from the Tapestry Frameworks that's
>> throwing the exception:
>> 
>>            Object valueObject =
>> getDataSqueezer().unsqueeze(submittedValue);
>>            if (!(valueObject instanceof Boolean))
>>                throw new
>> ApplicationRuntimeException(Tapestry.format("If.invalid-condition-type",
>> submittedValue));
>>            return ((Boolean) valueObject).booleanValue();
>> 
>> I haven't gone deep enough in the process to know if the unsqueeze is
>> throwing the exception or if it's the exception
>> thrown after the if instanceof.
>> 
>> 
>> Any suggestions or ideas??
>> 
>> 
>> Tony Giaccone
>> 
> 
> 

Reply via email to