• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

StackOverflowException

 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am getting a StackOverflowException. of course there is not stack trace displayed like with other exceptions. ive looked over the code, but didnt notice anything right away. fortunately there is not all that much new code since i last ran it but i changed seveal things at once. any tips or suggestions as to how to find the problem or what might be causing it? im thinking either i can try to follow the flow of execution, or try commenting out code till it goes away. any other ideas?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typically StackOverflowException is caused by an infinite recursion of some sort. Look for a method calling itself, or calling another method which calls the first method (or A calls B calls C calls A, etc). Typically I'd add some logging statements (could be as simple as System.out.println(message)) to know what's being executed, what hasn't, and what's being executed repeatedly. You could also use a good debugger I suppose, follow the exectution that way.
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that sounds like a good approach Jim. ive used System.out.println() for debugging before...never have gotten used to using the debugging tools in IDE's for some reason. :roll:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic