You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dwight Farris <df...@email.arizona.edu> on 2007/06/01 17:43:29 UTC

Arithmetic Exception

Hello Everyone,
I am receiving what I interpret as a 'divide by zero' error -

StandardWrapperValve[action]: Servlet.service() for servlet action 
threw exception
java.lang.ArithmeticException: / by zero
         at edu.uc.cohorts.util.Util.calcCohortAllotment(Util.java:123)
         at 
edu.uc.cohorts.util.CohortAssignmentDB.AssignCohort(CohortAssignmentDB.java:720)


The class code for the string calcCohortAllotment  is below -

string = calcCohortAllotment
string = (Ljava/lang/Integer;)Ljava/lang/String;
name = calcCohortAllotment, descriptor=(Ljava/lang/integer;)Ljava/lang/String;
class = edu/uc/cohorts/util/Util; name=calcCohortAllotment, 
descriptor=(Ljava/lang/integer;)Ljava/lang/String;
string = ok

Any assistance is greatly appreciated,
Dwight

RE: [OT] Arithmetic Exception

Posted by Dwight Farris <df...@email.arizona.edu>.
Thanks for the response; I will check the code.
Dwight

At 08:52 AM 6/1/2007, you wrote:
> > From: Dwight Farris [mailto:dfarris@email.arizona.edu]
> > Subject: Arithmetic Exception
> >
> > I am receiving what I interpret as a 'divide by zero' error -
> >
> > java.lang.ArithmeticException: / by zero
> >          at
> > edu.uc.cohorts.util.Util.calcCohortAllotment(Util.java:123)
>
>"Doctor, doctor, it hurts when I do this!"
>
>This is an error in the code of your webapp; as good as Tomcat is, it
>can't correct basic programming errors in user code.  The exception is
>telling you exactly where to look for the problem.
>
>You need to either check for zero before the divide, or catch the
>exception in your code, or configure an error page for the situation if
>you want to display something pretty to the end user.
>
>  - Chuck
>
>
>THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>MATERIAL and is thus for use only by the intended recipient. If you
>received this in error, please contact the sender and delete the e-mail
>and its attachments from all computers.
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] Arithmetic Exception

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dwight Farris [mailto:dfarris@email.arizona.edu] 
> Subject: Arithmetic Exception
> 
> I am receiving what I interpret as a 'divide by zero' error -
> 
> java.lang.ArithmeticException: / by zero
>          at 
> edu.uc.cohorts.util.Util.calcCohortAllotment(Util.java:123)

"Doctor, doctor, it hurts when I do this!"

This is an error in the code of your webapp; as good as Tomcat is, it
can't correct basic programming errors in user code.  The exception is
telling you exactly where to look for the problem.

You need to either check for zero before the divide, or catch the
exception in your code, or configure an error page for the situation if
you want to display something pretty to the end user.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org