app engine req.getParameter with type float [message #835042] |
Mon, 02 April 2012 14:23  |
Eclipse User |
|
|
|
Hi,
0down votefavorite
share [g+]share [fb]share [tw]
I'm trying to do something very similar to the Guestbook which is in the App Engine tutorial (get started). However, I want to modified the types of the fields in the form. Eclipse doesn't show any error, but the server says:
HTTP ERROR 500 Problem accessing /. Reason:
java.lang.String cannot be cast to java.lang.Long
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long at org.datanucleus.store.appengine.TypeConversionUtils$1.apply(TypeConversionUtils.java:47) at org.datanucleus.store.appengine.TypeConversionUtils$1.apply(TypeConversionUtils.java:45) at org.datanucleus.store.appengine.TypeConversionUtils.datastoreValueToPojoValue(TypeConversionUtils.java:317) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField
This is what I'm doing:
@Persistent private float weight;
public Greeting (User author, String content, Date date, String weight) { this.author = author;
this.content = content;
this.date = date;
this.weight = Float.parseFloat(weight); }
public float getWeight() {
return weight; }
I don't know where the error is...
Thank you in advance!!
|
|
|
|
Powered by
FUDForum. Page generated in 0.06096 seconds