I wrote the source code as follows in dopost function that is in one of
the servlet classes
...............................
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Float fw=Float.parseFloat(req.getParameter("frmWeight"));
Float fh=Float.parseFloat(req.getParameter("frmHeight"));
Float bmi=(float)0;
String type=req.getParameter("frmType");
if(type.equals("lb/inches")){
bmi=(fw*(float)703)/(fh*fh);
}else if(type.equals("kg/m")){
bmi=fw/(fh*fh);
}
String status=new String();
if(bmi<=(float)18.5) status="Underweight";
else if(bmi>(float)18.5 && bmi<=(float)24.9) status="Normal";
else if(bmi>(float)25 && bmi<=(float)29.9) status="Overweight";
else if(bmi>=(float)30 ) status="Obese";
BMI myB=new BMI();
myB.setBmi(bmi);
myB.setHeight(fh);
myB.setHistDate(new Date());
myB.setUnit(type);
myB.setWeight(fw);
myB.setWeightStatus(status);
myB.setPersonName((String)req.getSession().getAttribute("loginPKey"));
BMIJDO myBmiJDO=new BMIJDO();
myBmiJDO.saveNewEmployer(myB);
List<BMI>
l=myBmiJDO.getAll((String)req.getSession().getAttribute("loginPKey"));
req.setAttribute("bmisize","1");
req.setAttribute("histList",l);
RequestDispatcher r=req.getRequestDispatcher("jsp/bmi_history.jsp");
r.forward(req, resp);
.............................................
-->> it works ok in local
*** But i got the error message ...Numberformat exception when i press the
calculate button (the project is already deploymented to GAE )
I got that error in the log as u said
with regards,
:)
On Sat, Dec 3, 2011 at 7:53 PM, Nandar Wai Yee <[email protected]>wrote:
> I saw the following errors in the Logs...:(
>
> 1. 2011-12-01 13:32:56.097 /bmiHistoryCalculate 500 180ms 0kb Mozilla/5.0
> (Windows NT 6.0; WOW64) AppleWebKit/535.2 (KHTML, like Gecko)
> Chrome/15.0.874.121 Safari/535.2
>
> 129.234.230.69 - - [01/Dec/2011:13:32:56 -0800] "POST /bmiHistoryCalculate
> HTTP/1.1" 500 0 "http://hz-uak-app.appspot.com/save_login" "Mozilla/5.0
> (Windows NT 6.0; WOW64) AppleWebKit/535.2 (KHTML, like Gecko)
> Chrome/15.0.874.121 Safari/535.2" "hz-uak-app.appspot.com" ms=181 cpu_ms=47
> api_cpu_ms=0 cpm_usd=0.001359 instance=00c61b117c3bee08d2ece9b139d1e4c70d8e77
>
> 2. W 2011-12-01 13:32:56.093
>
> /bmiHistoryCalculate
> java.lang.NumberFormatException: For input string: "1,8"
> at
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1248)
> at java.lang.Float.parseFloat(Float.java:439)
> at
> ndwy.exercise.uak.controller.BMIHistoryCalculateServlet.doPost(BMIHistoryCalculateServlet.java:31)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
> at
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
> at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
> at
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
> at
> com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:392)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
> at
> com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
> at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
> at
> com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
> at
> com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
> at
> com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:162)
> at java.lang.Thread.run(Thread.java:679)
>
>
>
>
> On Thu, Dec 1, 2011 at 4:36 PM, Abhishek Mathur <[email protected]>wrote:
>
>> Hi ,
>>
>> Please go to your application dashboard on GAE and on the left hand side
>> you will see a link to your logs. You can have a look at the logs there and
>> if you find any error you can post it here.
>>
>> --Thanks
>> Abhishek
>>
>>
>>
>> On Thu, Dec 1, 2011 at 12:33 PM, Nandar Wai Yee
>> <[email protected]>wrote:
>>
>>> hello
>>> Sorry for my late reply coz of my exam ....
>>> My project hasn't any error message ...this is very strange for me
>>> But I wanna to show u my link to test ....i uploaded my project to
>>> Google App Engine....
>>>
>>> http://hz-uak-app.appspot.com/
>>>
>>> Please check my link ..pls
>>> in ewb.xml, i set session-enable=true ...
>>> but i didn't get answer ...:( i don't know what i'm wrong ...
>>> Waiting ur reply
>>>
>>>
>>> On Wed, Oct 19, 2011 at 3:41 AM, Greg <[email protected]> wrote:
>>>
>>>> Please post the error message you get when you press the calculate
>>>> button. You can find this in the log, which is in the admin dashboard.
>>>>
>>>> Without this information, no-one can help you.
>>>>
>>>> Cheers
>>>> Greg.
>>>>
>>>> On Oct 15, 7:05 am, Nandar Wai Yee <[email protected]> wrote:
>>>> > Hello Masters,
>>>> >
>>>> > I want a solution for my problem....
>>>> >
>>>> > The problem is that ..how to move my data to the cloud.
>>>> > I built an application.
>>>> > It is ok in local ...no error....it can show the result
>>>> > without any difficulty.
>>>> > But after i deployed my application to the web, my
>>>> > application can't work well as in local.
>>>> > I mean, when i put an input to the input box, then i
>>>> pressed
>>>> > calculate button, the result cannot be shown.
>>>> > How can i change which part of the code and where?
>>>> > I am waiting forward ur reply.
>>>> >
>>>> > with best regards,
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google App Engine" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-appengine?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> Yours,
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>
>
> --
> Yours,
>
>
>
>
>
>
> nandar
>
>
>
>
>
>
--
Yours,
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.