Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » app engine req.getParameter with type float
app engine req.getParameter with type float [message #835042] Mon, 02 April 2012 14:23 Go to next message
Natalia Molinero is currently offline Natalia Molinero
Messages: 1
Registered: April 2012
Junior Member
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!!
Re: app engine req.getParameter with type float [message #835141 is a reply to message #835042] Mon, 02 April 2012 17:12 Go to previous message
David Wegener is currently offline David Wegener
Messages: 1336
Registered: July 2009
Senior Member
Not a JDT question. Ask in a Web Development forum.
Previous Topic:BugZilla... Is It Being Actioned?
Next Topic:Intellisense does not work for one class
Goto Forum:
  


Current Time: Sat Aug 30 02:27:08 EDT 2014

Powered by FUDForum. Page generated in 0.01581 seconds