File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Stackoverflow without recursion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Stackoverflow without recursion" Watch "Stackoverflow without recursion" New topic

Stackoverflow without recursion

Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
Hi, I had posted earlier with an overview of my StackOverFlow Error problem. Now I have got some clues in this. The servlet is throwing a Stackoverflow error at Properties.getProperty() method. I know that stackoverflow occurs as a result of recursions. But I am not making any recursive calls in my code. I don't know why this error is bugging me. The code segment and the exceptions are listed below:

The exceptions:

Any clues will be appreciated. :roll:

RAGHU<br /> <br />"When the going gets tough, the tough get going"
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1090
Did you debug the application.

Why is this being printed so many times

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Are you sure it's happening there ?
Is there any other places you are using Properties, using the following constructor ? Properties(Properties defaults)

[My Blog]
All roads lead to JavaRanch
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

I agree that it must be some other call that's causing this problem, but I don't think this is your actual code in the first place. Note that this line of code wouldn't even compile:

[Jess in Action][AskingGoodQuestions]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

From the API documentation for Properties:
A property list can contain another property list as its "defaults"; this second property list is searched if the property key is not found in the original property list.
So if you created a Properties object that was its own default, and you searched it for a key it didn't contain, what would happen?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Yep, that is why I asked if he was calling using Properties(Properties defaults) somewhere else
I agree. Here's the link:
subject: Stackoverflow without recursion
It's not a secret anymore!