You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Marc A. Donis" <ma...@runbox.com> on 2007/10/28 17:25:27 UTC

upgrading 5.0.5 to 5.0.6 breaks the app

Hi again,

First off, I am having an issue (with 5.0.5) concerning returning null from 
my ValueEncoder's toValue method.  I expect the value to be simply set to 
null, but instead I get the message:

    Coercion of null to type java.lang.Integer (via null --> String, 
String --> Long, Long --> Integer) failed: null

when I select "---" (i.e., null) in my select component.  Here is the 
ValueEncoder code I am using:

private static final ValueEncoder<Integer> integerValueEncoder = new 
ValueEncoder<Integer>() {
    @Override
    public String toClient(Integer i) {
    if (i == null)
        return null;
    return String.valueOf(i);
}

@Override
public Integer toValue(String str) {
    if (str == null || str.length() == 0 || str.equals("---"))
        return null;    // *** crashes after doing this ***
    return Integer.parseInt(str);
}
};

My SelectModel uses the string "---" to represent no selection.

I read something ( https://issues.apache.org/jira/browse/TAPESTRY-1648 ) 
which led me to believe that this problem was fixed in 5.0.6, so I upgraded 
my vesion....

After changing my imports of Inject to 
"org.apache.tapestry.annotations.ioc.Inject" (instead of 
"org.apache.tapestry.annotations.Inject"), 5.0.6 now causes this error 
immediately on load of Start:

HTTP ERROR: 500
Internal Server Error
RequestURI=/app/
Powered by Jetty://

and all I see in the console is:

0:0:0:0:0:0:0:1 - - [28/Oct/2007:17:06:02 +0100] "GET /app/ HTTP/1.1" 500 
1245 "http://localhost:8080/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; 
en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8" -

which is not terribly helpful.

I'm at a bit of a loss here.  Why is 5.0.6 failing so dramatically?  And am 
I doing something wrong with my encoder, or is this really the bug I think 
it is?

tia,
Marc


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


Re: T5: How to upgrade from 5.0.5 to 5.0.6

Posted by Marcus <mv...@gmail.com>.
Some related links:

http://tapestryjava.blogspot.com/2007/10/tapestry-506-is-available.html

http://tapestryjava.blogspot.com/2007/10/big-improvement-to-quickstart-archetype.html

Re: T5: How to upgrade from 5.0.5 to 5.0.6

Posted by Josh Canfield <jo...@thedailytube.com>.
I've kept my .tml and .properties files in the resources folder which get
put into the jar file along side the classes. Is there any value to moving
them to the webapp folder?

Josh

On 10/30/07, Marc A. Donis <ma...@runbox.com> wrote:
>
> Yep, I just figured that out... thanks!
>
> Also, it is necessary (as mentioned in the "[5.0.6-SNAPSHOT] Bug?
> isTraceEnabled missing when I switch to slf4j " thread) to replace
> log4j-1.2.8.jar with log4j-1.2.14.jar in the jetty/ext dir.
>
> Now things seem to be working again.  Thanks again for the help.
>
> Marc
>
> ----- Original Message -----
> From: "Lindsay Steele" <lg...@gmail.com>
> To: "Tapestry users" <us...@tapestry.apache.org>
> Sent: Tuesday, October 30, 2007 22:37
> Subject: Re: T5: How to upgrade from 5.0.5 to 5.0.6
>
>
> >
> >
> > Marc A. Donis wrote:
> >>
> >> - moved *.tml (and *.properties ?) from
> src/main/resources/org/app/pages
> >> to src/main/webapp/WEB-INF  (is this the right place??)
> >>
> >
> > You pages should be in src/main/webapp
> >
> > ---------------------------------------------------------------------
> > 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
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5: How to upgrade from 5.0.5 to 5.0.6

Posted by "Marc A. Donis" <ma...@runbox.com>.
Yep, I just figured that out... thanks!

Also, it is necessary (as mentioned in the "[5.0.6-SNAPSHOT] Bug? 
isTraceEnabled missing when I switch to slf4j " thread) to replace 
log4j-1.2.8.jar with log4j-1.2.14.jar in the jetty/ext dir.

Now things seem to be working again.  Thanks again for the help.

Marc

----- Original Message ----- 
From: "Lindsay Steele" <lg...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Tuesday, October 30, 2007 22:37
Subject: Re: T5: How to upgrade from 5.0.5 to 5.0.6


>
>
> Marc A. Donis wrote:
>>
>> - moved *.tml (and *.properties ?) from src/main/resources/org/app/pages 
>> to src/main/webapp/WEB-INF  (is this the right place??)
>>
>
> You pages should be in src/main/webapp
>
> ---------------------------------------------------------------------
> 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: How to upgrade from 5.0.5 to 5.0.6

Posted by Lindsay Steele <lg...@gmail.com>.

Marc A. Donis wrote:
>
> - moved *.tml (and *.properties ?) from 
> src/main/resources/org/app/pages to src/main/webapp/WEB-INF  (is this 
> the right place??)
>

You pages should be in src/main/webapp

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


Re: T5: How to upgrade from 5.0.5 to 5.0.6

Posted by "Marc A. Donis" <ma...@runbox.com>.
Hi,

Still having major problems upgrading to 5.0.6.  I was hoping this would be 
a little less painful than having to create a whole new project...

I have:

- changed the tapestry version to 5.0.6 in pom.xml
- changed the log4j version to 1.2.14 in pom.xml
- renamed all *.html files to *.tml
- moved *.tml (and *.properties ?) from src/main/resources/org/app/pages to 
src/main/webapp/WEB-INF  (is this the right place??)
- fixed compilation problems by importing 
org.apache.tapestry.ioc.annotations.Inject
- changed the method signature in AppModule.java to:
     public RequestFilter buildTimingFilter(final Logger log)
- also in AppModule.java: import org.slf4j.Logger

Now I get:

HTTP ERROR: 500

org.apache.log4j.Logger.isTraceEnabled()Z

RequestURI=/app/

Powered by Jetty://


and in the console, I see a lot of:

Caused by: org.apache.tapestry.ioc.internal.util.TapestryException: 
Component Start does not contain an embedded component with id 'login'.

... which is odd, because my Start.tml file has a:

  <t:form t:id="login">

in it, which implies to me that maybe it isn't finding the Start.tml file at 
all?

Any hints?

Thanks again,
Marc


----- Original Message ----- 
From: "Nick Westgate" <ni...@key-planning.co.jp>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, October 29, 2007 03:52
Subject: Re: upgrading 5.0.5 to 5.0.6 breaks the app


> Please look for the recent thread "T5: How to upgrade from 5.0.5 to 
> 5.0.6".
>
> Cheers,
> Nick.
>
>
> Marc A. Donis wrote:
>> Hi again,
>>
>> First off, I am having an issue (with 5.0.5) concerning returning null 
>> from my ValueEncoder's toValue method.  I expect the value to be simply 
>> set to null, but instead I get the message:
>>
>>    Coercion of null to type java.lang.Integer (via null --> String, 
>> String --> Long, Long --> Integer) failed: null
>>
>> when I select "---" (i.e., null) in my select component.  Here is the 
>> ValueEncoder code I am using:
>>
>> private static final ValueEncoder<Integer> integerValueEncoder = new 
>> ValueEncoder<Integer>() {
>>    @Override
>>    public String toClient(Integer i) {
>>    if (i == null)
>>        return null;
>>    return String.valueOf(i);
>> }
>>
>> @Override
>> public Integer toValue(String str) {
>>    if (str == null || str.length() == 0 || str.equals("---"))
>>        return null;    // *** crashes after doing this ***
>>    return Integer.parseInt(str);
>> }
>> };
>>
>> My SelectModel uses the string "---" to represent no selection.
>>
>> I read something ( https://issues.apache.org/jira/browse/TAPESTRY-1648 ) 
>> which led me to believe that this problem was fixed in 5.0.6, so I 
>> upgraded my vesion....
>>
>> After changing my imports of Inject to 
>> "org.apache.tapestry.annotations.ioc.Inject" (instead of 
>> "org.apache.tapestry.annotations.Inject"), 5.0.6 now causes this error 
>> immediately on load of Start:
>>
>> HTTP ERROR: 500
>> Internal Server Error
>> RequestURI=/app/
>> Powered by Jetty://
>>
>> and all I see in the console is:
>>
>> 0:0:0:0:0:0:0:1 - - [28/Oct/2007:17:06:02 +0100] "GET /app/ HTTP/1.1" 500 
>> 1245 "http://localhost:8080/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; 
>> en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8" -
>>
>> which is not terribly helpful.
>>
>> I'm at a bit of a loss here.  Why is 5.0.6 failing so dramatically?  And 
>> am I doing something wrong with my encoder, or is this really the bug I 
>> think it is?
>>
>> tia,
>> Marc
>>
>>
>> ---------------------------------------------------------------------
>> 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: upgrading 5.0.5 to 5.0.6 breaks the app

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Please look for the recent thread "T5: How to upgrade from 5.0.5 to 5.0.6".

Cheers,
Nick.


Marc A. Donis wrote:
> Hi again,
> 
> First off, I am having an issue (with 5.0.5) concerning returning null 
> from my ValueEncoder's toValue method.  I expect the value to be simply 
> set to null, but instead I get the message:
> 
>    Coercion of null to type java.lang.Integer (via null --> String, 
> String --> Long, Long --> Integer) failed: null
> 
> when I select "---" (i.e., null) in my select component.  Here is the 
> ValueEncoder code I am using:
> 
> private static final ValueEncoder<Integer> integerValueEncoder = new 
> ValueEncoder<Integer>() {
>    @Override
>    public String toClient(Integer i) {
>    if (i == null)
>        return null;
>    return String.valueOf(i);
> }
> 
> @Override
> public Integer toValue(String str) {
>    if (str == null || str.length() == 0 || str.equals("---"))
>        return null;    // *** crashes after doing this ***
>    return Integer.parseInt(str);
> }
> };
> 
> My SelectModel uses the string "---" to represent no selection.
> 
> I read something ( https://issues.apache.org/jira/browse/TAPESTRY-1648 ) 
> which led me to believe that this problem was fixed in 5.0.6, so I 
> upgraded my vesion....
> 
> After changing my imports of Inject to 
> "org.apache.tapestry.annotations.ioc.Inject" (instead of 
> "org.apache.tapestry.annotations.Inject"), 5.0.6 now causes this error 
> immediately on load of Start:
> 
> HTTP ERROR: 500
> Internal Server Error
> RequestURI=/app/
> Powered by Jetty://
> 
> and all I see in the console is:
> 
> 0:0:0:0:0:0:0:1 - - [28/Oct/2007:17:06:02 +0100] "GET /app/ HTTP/1.1" 
> 500 1245 "http://localhost:8080/" "Mozilla/5.0 (Windows; U; Windows NT 
> 6.0; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8" -
> 
> which is not terribly helpful.
> 
> I'm at a bit of a loss here.  Why is 5.0.6 failing so dramatically?  And 
> am I doing something wrong with my encoder, or is this really the bug I 
> think it is?
> 
> tia,
> Marc
> 
> 
> ---------------------------------------------------------------------
> 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