You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2008/04/28 10:40:45 UTC

T5 Activation/Passivation - strangeness

Hi,

In our project we get the following message passivating/activating
pages:

java.lang.NumberFormatException: For input string: "favicon.ico"

The more details stack trace shows:

Caused by: 
java.lang.RuntimeException: Coercion of favicon.ico to type
java.lang.Long (via String --> Long) failed: For input string:
"favicon.ico"
	at
org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
	at $TypeCoercer_119942e9313.coerce($TypeCoercer_119942e9313.java)
	at org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory
$1.toValue(TypeCoercedValueEncoderFactory.java:45)
	at
org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
	at
$ContextValueEncoder_119942e9349.toValue($ContextValueEncoder_119942e9349.java)
	at
org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:43)
	at
org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
	... 47 more
Caused by: 
java.lang.NumberFormatException: For input string: "favicon.ico"
	at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:60)
	at java.lang.Long.parseLong(Long.java:415)
	at java.lang.Long.<init>(Long.java:683)
	at org.apache.tapestry.ioc.services.TapestryIOCModule
$7.coerce(TapestryIOCModule.java:159)
	at org.apache.tapestry.ioc.services.TapestryIOCModule
$7.coerce(TapestryIOCModule.java:157)
	at org.apache.tapestry.ioc.services.CoercionTuple
$CoercionWrapper.coerce(CoercionTuple.java:54)
	at
org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
	... 53 more


Why is our favicon.ico being tried as a Long coerced value?

-J.


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


Re: T5 Activation/Passivation - strangeness

Posted by Chris Lewis <ch...@bellsouth.net>.
Can you share some template code? Perhaps of the layout if you can.

Jan Vissers wrote:
> Hi,
>
> In our project we get the following message passivating/activating
> pages:
>
> java.lang.NumberFormatException: For input string: "favicon.ico"
>
> The more details stack trace shows:
>
> Caused by: 
> java.lang.RuntimeException: Coercion of favicon.ico to type
> java.lang.Long (via String --> Long) failed: For input string:
> "favicon.ico"
> 	at
> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
> 	at $TypeCoercer_119942e9313.coerce($TypeCoercer_119942e9313.java)
> 	at org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory
> $1.toValue(TypeCoercedValueEncoderFactory.java:45)
> 	at
> org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
> 	at
> $ContextValueEncoder_119942e9349.toValue($ContextValueEncoder_119942e9349.java)
> 	at
> org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:43)
> 	at
> org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
> 	... 47 more
> Caused by: 
> java.lang.NumberFormatException: For input string: "favicon.ico"
> 	at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:60)
> 	at java.lang.Long.parseLong(Long.java:415)
> 	at java.lang.Long.<init>(Long.java:683)
> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> $7.coerce(TapestryIOCModule.java:159)
> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> $7.coerce(TapestryIOCModule.java:157)
> 	at org.apache.tapestry.ioc.services.CoercionTuple
> $CoercionWrapper.coerce(CoercionTuple.java:54)
> 	at
> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
> 	... 53 more
>
>
> Why is our favicon.ico being tried as a Long coerced value?
>
> -J.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


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


Re: T5 Activation/Passivation - strangeness

Posted by Jan Vissers <Ja...@cumquat.nl>.
On Mon, 2008-04-28 at 10:57 +0200, Chris Lewis wrote:
> Can you share the full code? What are your activate/passivate methods
> doing? 

For instance this:

 public void onActivate(Long familyId) {
    this.familyIdContext = familyId;
    family = familyDAO.findFamilyWithProducts(familyId);     
 }
    
 public Long onPassivate() {
    return familyIdContext;
 }


> Does that get thrown when the layout is used with a page that has
> no activation context? 

The error gets thrown only on pages that *do* have an activation
context.

> If so, and that really is all to the template
> code, I would say it's a bug. Share more code if you can.

Another thing - although the error gets thrown the application behaves
'normally'.

> 
> chris
> 
> Jan Vissers wrote:
> > Our layout component has:
> >
> > <link rel="shortcut icon" href="favicon.ico"/>
> >
> > If we remove this element - the error disappears. Now this must be a
> > bug, right?
> >
> > -J.
> >
> > On Mon, 2008-04-28 at 10:40 +0200, Jan Vissers wrote:
> >   
> >> Hi,
> >>
> >> In our project we get the following message passivating/activating
> >> pages:
> >>
> >> java.lang.NumberFormatException: For input string: "favicon.ico"
> >>
> >> The more details stack trace shows:
> >>
> >> Caused by: 
> >> java.lang.RuntimeException: Coercion of favicon.ico to type
> >> java.lang.Long (via String --> Long) failed: For input string:
> >> "favicon.ico"
> >> 	at
> >> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
> >> 	at $TypeCoercer_119942e9313.coerce($TypeCoercer_119942e9313.java)
> >> 	at org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory
> >> $1.toValue(TypeCoercedValueEncoderFactory.java:45)
> >> 	at
> >> org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
> >> 	at
> >> $ContextValueEncoder_119942e9349.toValue($ContextValueEncoder_119942e9349.java)
> >> 	at
> >> org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:43)
> >> 	at
> >> org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
> >> 	... 47 more
> >> Caused by: 
> >> java.lang.NumberFormatException: For input string: "favicon.ico"
> >> 	at
> >> java.lang.NumberFormatException.forInputString(NumberFormatException.java:60)
> >> 	at java.lang.Long.parseLong(Long.java:415)
> >> 	at java.lang.Long.<init>(Long.java:683)
> >> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> >> $7.coerce(TapestryIOCModule.java:159)
> >> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> >> $7.coerce(TapestryIOCModule.java:157)
> >> 	at org.apache.tapestry.ioc.services.CoercionTuple
> >> $CoercionWrapper.coerce(CoercionTuple.java:54)
> >> 	at
> >> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
> >> 	... 53 more
> >>
> >>
> >> Why is our favicon.ico being tried as a Long coerced value?
> >>
> >> -J.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>     
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: T5 Activation/Passivation - strangeness

Posted by Chris Lewis <ch...@bellsouth.net>.
Can you share the full code? What are your activate/passivate methods
doing? Does that get thrown when the layout is used with a page that has
no activation context? If so, and that really is all to the template
code, I would say it's a bug. Share more code if you can.

chris

Jan Vissers wrote:
> Our layout component has:
>
> <link rel="shortcut icon" href="favicon.ico"/>
>
> If we remove this element - the error disappears. Now this must be a
> bug, right?
>
> -J.
>
> On Mon, 2008-04-28 at 10:40 +0200, Jan Vissers wrote:
>   
>> Hi,
>>
>> In our project we get the following message passivating/activating
>> pages:
>>
>> java.lang.NumberFormatException: For input string: "favicon.ico"
>>
>> The more details stack trace shows:
>>
>> Caused by: 
>> java.lang.RuntimeException: Coercion of favicon.ico to type
>> java.lang.Long (via String --> Long) failed: For input string:
>> "favicon.ico"
>> 	at
>> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
>> 	at $TypeCoercer_119942e9313.coerce($TypeCoercer_119942e9313.java)
>> 	at org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory
>> $1.toValue(TypeCoercedValueEncoderFactory.java:45)
>> 	at
>> org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
>> 	at
>> $ContextValueEncoder_119942e9349.toValue($ContextValueEncoder_119942e9349.java)
>> 	at
>> org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:43)
>> 	at
>> org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
>> 	... 47 more
>> Caused by: 
>> java.lang.NumberFormatException: For input string: "favicon.ico"
>> 	at
>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:60)
>> 	at java.lang.Long.parseLong(Long.java:415)
>> 	at java.lang.Long.<init>(Long.java:683)
>> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
>> $7.coerce(TapestryIOCModule.java:159)
>> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
>> $7.coerce(TapestryIOCModule.java:157)
>> 	at org.apache.tapestry.ioc.services.CoercionTuple
>> $CoercionWrapper.coerce(CoercionTuple.java:54)
>> 	at
>> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
>> 	... 53 more
>>
>>
>> Why is our favicon.ico being tried as a Long coerced value?
>>
>> -J.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Antwort: Re: T5 Activation/Passivation - strangeness

Posted by Jan Vissers <Ja...@cumquat.nl>.
Wow!
Yes - this was it indeed.

Thx,
-J.

On Mon, 2008-04-28 at 11:20 +0200, Christian Koeberl wrote:
> > Jan Vissers <Ja...@cumquat.nl> wrote:
> > Our layout component has:
> > <link rel="shortcut icon" href="favicon.ico"/>
> 
> If you have this in your code the browser will request 
> "/yourpage/favicon.ico" or "mypackage/mypage/favicon.ico". Tapestry treats 
> "favicon.ico" as an activation context. I think you have a 
> onActivate(Long) in your page. So, Tapestry tries to coerce favicon.ico to 
> a long which fails. 
> 
> Maybe you should try:
> <link rel="shortcut icon" href="${asset:context:favicon.ico}"/>
> 
> -- 
> Chris


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


Re: Antwort: Re: T5 Activation/Passivation - strangeness

Posted by Chris Lewis <ch...@bellsouth.net>.
Good eyes! I assume it would have worked if the url had been absolute,
in which case tapestry would not have interpreted it as a page render
... or maybe not.

Christian Koeberl wrote:
>> Jan Vissers <Ja...@cumquat.nl> wrote:
>> Our layout component has:
>> <link rel="shortcut icon" href="favicon.ico"/>
>>     
>
> If you have this in your code the browser will request 
> "/yourpage/favicon.ico" or "mypackage/mypage/favicon.ico". Tapestry treats 
> "favicon.ico" as an activation context. I think you have a 
> onActivate(Long) in your page. So, Tapestry tries to coerce favicon.ico to 
> a long which fails. 
>
> Maybe you should try:
> <link rel="shortcut icon" href="${asset:context:favicon.ico}"/>
>
>   

-- 
http://thegodcode.net


Antwort: Re: T5 Activation/Passivation - strangeness

Posted by Christian Koeberl <ch...@porsche.co.at>.
> Jan Vissers <Ja...@cumquat.nl> wrote:
> Our layout component has:
> <link rel="shortcut icon" href="favicon.ico"/>

If you have this in your code the browser will request 
"/yourpage/favicon.ico" or "mypackage/mypage/favicon.ico". Tapestry treats 
"favicon.ico" as an activation context. I think you have a 
onActivate(Long) in your page. So, Tapestry tries to coerce favicon.ico to 
a long which fails. 

Maybe you should try:
<link rel="shortcut icon" href="${asset:context:favicon.ico}"/>

-- 
Chris

Re: T5 Activation/Passivation - strangeness

Posted by Jan Vissers <Ja...@cumquat.nl>.
Our layout component has:

<link rel="shortcut icon" href="favicon.ico"/>

If we remove this element - the error disappears. Now this must be a
bug, right?

-J.

On Mon, 2008-04-28 at 10:40 +0200, Jan Vissers wrote:
> Hi,
> 
> In our project we get the following message passivating/activating
> pages:
> 
> java.lang.NumberFormatException: For input string: "favicon.ico"
> 
> The more details stack trace shows:
> 
> Caused by: 
> java.lang.RuntimeException: Coercion of favicon.ico to type
> java.lang.Long (via String --> Long) failed: For input string:
> "favicon.ico"
> 	at
> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
> 	at $TypeCoercer_119942e9313.coerce($TypeCoercer_119942e9313.java)
> 	at org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory
> $1.toValue(TypeCoercedValueEncoderFactory.java:45)
> 	at
> org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
> 	at
> $ContextValueEncoder_119942e9349.toValue($ContextValueEncoder_119942e9349.java)
> 	at
> org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:43)
> 	at
> org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
> 	... 47 more
> Caused by: 
> java.lang.NumberFormatException: For input string: "favicon.ico"
> 	at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:60)
> 	at java.lang.Long.parseLong(Long.java:415)
> 	at java.lang.Long.<init>(Long.java:683)
> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> $7.coerce(TapestryIOCModule.java:159)
> 	at org.apache.tapestry.ioc.services.TapestryIOCModule
> $7.coerce(TapestryIOCModule.java:157)
> 	at org.apache.tapestry.ioc.services.CoercionTuple
> $CoercionWrapper.coerce(CoercionTuple.java:54)
> 	at
> org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
> 	... 53 more
> 
> 
> Why is our favicon.ico being tried as a Long coerced value?
> 
> -J.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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