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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to