| | |
stackoverflow error
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
hi all,
does anyone know much about the FESI interpreter ??? i am getting an error while using this third party product (GTX) which is written in java and i cant work out whats wrong. FESI is built into this product which i am using so i dont know the details of how it interprets the script which i write.
error that gets thrown is :
[8/07/09 10:36:23:755 NZST] 133e76d ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "onInput" on bean "BeanId(GTX_Test#GTXEJB.jar#GTProcessEngineEJB , 1225754b587)". Exception data: java.lang.StackOverflowError
at com.gtnet.pk.ecmas.extensions.GTDecimalPrototype.g etDefaultValue(GTDecimalPrototype.java:287)
at FESI.Data.ESObject.getDefaultValue(ESObject.java:4 99)
at FESI.Data.ESObject.toESPrimitive(ESObject.java:667 )
at FESI.Interpreter.EcmaScriptEvaluateVisitor.equal(E cmaScriptEvaluateVisitor.java:310)
at FESI.Interpreter.EcmaScriptEvaluateVisitor.equal(E cmaScriptEvaluateVisitor.java:310)
this error gets thrown when i try and reference a field from a user defined object e.g
but it works fine when :
any help to understand how/why the above works would be much appreciated.
ta.
does anyone know much about the FESI interpreter ??? i am getting an error while using this third party product (GTX) which is written in java and i cant work out whats wrong. FESI is built into this product which i am using so i dont know the details of how it interprets the script which i write.
error that gets thrown is :
[8/07/09 10:36:23:755 NZST] 133e76d ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "onInput" on bean "BeanId(GTX_Test#GTXEJB.jar#GTProcessEngineEJB , 1225754b587)". Exception data: java.lang.StackOverflowError
at com.gtnet.pk.ecmas.extensions.GTDecimalPrototype.g etDefaultValue(GTDecimalPrototype.java:287)
at FESI.Data.ESObject.getDefaultValue(ESObject.java:4 99)
at FESI.Data.ESObject.toESPrimitive(ESObject.java:667 )
at FESI.Interpreter.EcmaScriptEvaluateVisitor.equal(E cmaScriptEvaluateVisitor.java:310)
at FESI.Interpreter.EcmaScriptEvaluateVisitor.equal(E cmaScriptEvaluateVisitor.java:310)
this error gets thrown when i try and reference a field from a user defined object e.g
if( dbObject.ID == 0) but it works fine when :
var tmpID = dbObject.ID + 0 ;
if(tmpID == 0) ......any help to understand how/why the above works would be much appreciated.
ta.
Last edited by cesarnz; Aug 3rd, 2009 at 9:18 pm.
•
•
Join Date: Sep 2008
Posts: 1,629
Reputation:
Solved Threads: 206
I'm not sure of your level of experience so I'll post this just in case you don't know stack issues, which you may:
http://en.wikipedia.org/wiki/Stack_overflow
http://en.wikipedia.org/wiki/Stack_overflow
Out.
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
I'm not sure of your level of experience so I'll post this just in case you don't know stack issues, which you may:
http://en.wikipedia.org/wiki/Stack_overflow
hey thanks for the reply. I know about the logic behind stackoverflow error but what i cant understand is why does it throw this error on that particular line of code ?? its not even in a loop of any sort so i dont see a large stack of memory being built.
and why does it work if i declare a local variable and assign it the same value as before ??
once again thanks for your reply.
•
•
Join Date: Jul 2009
Posts: 48
Reputation:
Solved Threads: 7
[QUOTE=cesarnz;939193
...and why does it work if i declare a local variable and assign it the same value as before ??
.[/QUOTE]
Hi
When you assign a local variable the value of the object and ask for a comparison to 0 whit the operator == the two values are compared.
When you ask for the same thing to be done whit the object, and uses the operator == what you compare is not the value of the object but the objects referents (address) compared to 0.
If you want the value in the object to be compared to 0 then you have to use the method equals() instead of the == operator.
Hope this will give some help.
Good luck =)
...and why does it work if i declare a local variable and assign it the same value as before ??
.[/QUOTE]
Hi
When you assign a local variable the value of the object and ask for a comparison to 0 whit the operator == the two values are compared.
When you ask for the same thing to be done whit the object, and uses the operator == what you compare is not the value of the object but the objects referents (address) compared to 0.
If you want the value in the object to be compared to 0 then you have to use the method equals() instead of the == operator.
Hope this will give some help.
Good luck =)
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Hi
When you assign a local variable the value of the object and ask for a comparison to 0 whit the operator == the two values are compared.
When you ask for the same thing to be done whit the object, and uses the operator == what you compare is not the value of the object but the objects referents (address) compared to 0.
If you want the value in the object to be compared to 0 then you have to use the method equals() instead of the == operator.
Hope this will give some help.
Good luck =)
hi,
this makes sense but (theres always a but
) why would it compare address of the object when i have used the dot operator to reference the attribute of the object i.e ID ??so the object is 'dbObject' which holds an "attribute" named 'ID'. if i want to get the value of ID it is common in java to use the dot operator like dbObject.ID which gives you the value of the ID rather than the address.
Please correct me if i am wrong.
however its all happy when i declare a local variable and assign this variable the same value as above with a '+ 0' i.e
var tmpID = dbObject.ID + 0;
Even if it was comparing address of the object why would it cause stack overflow error ?
i cant make sense of this so need you good people to help.
Last edited by cesarnz; Aug 5th, 2009 at 6:17 pm.
>any help to understand how/why the above works would be much
>appreciated.
The problem you are facing could be very well because of a broken library implementation.
From what I can make out of the stacktrace, the implementation blows up when trying to convert the value of your object field i.e. ID to a primitive. Also given that it *works* when you add a zero to the ID field, I guess that there is some kind of implicit coercion taking place which makes the entire comparison *work* somehow.
Again, this is all guesswork and would be best answered on the forum for that given third party library. You can try printing out the value of "tmpID" in the second case; what does it give? NaN? Does printing out the value "dbObject.ID" cause the same stackoverflow issue?
>appreciated.
The problem you are facing could be very well because of a broken library implementation.
From what I can make out of the stacktrace, the implementation blows up when trying to convert the value of your object field i.e. ID to a primitive. Also given that it *works* when you add a zero to the ID field, I guess that there is some kind of implicit coercion taking place which makes the entire comparison *work* somehow.
Again, this is all guesswork and would be best answered on the forum for that given third party library. You can try printing out the value of "tmpID" in the second case; what does it give? NaN? Does printing out the value "dbObject.ID" cause the same stackoverflow issue?
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
>any help to understand how/why the above works would be much
>appreciated.
The problem you are facing could be very well because of a broken library implementation.
From what I can make out of the stacktrace, the implementation blows up when trying to convert the value of your object field i.e. ID to a primitive. Also given that it *works* when you add a zero to the ID field, I guess that there is some kind of implicit coercion taking place which makes the entire comparison *work* somehow.
Again, this is all guesswork and would be best answered on the forum for that given third party library. You can try printing out the value of "tmpID" in the second case; what does it give? NaN? Does printing out the value "dbObject.ID" cause the same stackoverflow issue?
Anyway i think you are right that there is some casting error behind the scenes in the libraries which is causing this error. Just cant figure out where.
![]() |
Similar Threads
- combo box containg check box as its elements in java (Java)
- StackOverflowException (C#)
- URGENT: JSP - StackOverFlow Error (JSP)
- VMWare Unrecoverable Error (*nix Software)
- Error in Wrox Book (Perl)
Other Threads in the Java Forum
- Previous Thread: Reading a .MDF SQL Server 2005 Express File with Jaba
- Next Thread: ')' expected
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






