aspose file tools*
The moose likes JSF and the fly likes Java Heap Space Error due to add function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Java Heap Space Error due to add function" Watch "Java Heap Space Error due to add function" New topic
Author

Java Heap Space Error due to add function

Amlan Karmakar
Greenhorn

Joined: Sep 20, 2012
Posts: 10
Whenever I am calling the getFriendList function from the xhtml page I am getting an exception. The page keeps on loading and after that I stop the browser. I get the given stackstrace. Its is telling me that there is an error at line no.78 friends.add(friend); . I think there is something wrong with my syntax. It would be helpful if someone point the error.


1)Here is my FriendBean it is request scoped.





2)Here is the exception that I am getting.

Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

Your code has a problem, it keeps on adding only the first User to the list and keeps on looping with that. Check out your logic at line 77. I would like you to figure it out and fix it.

Cheers.
Vishal


Programming is about thinking, NOT coding
chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 77

Get result.listIterator() outside while loop both in while condition and in first statement of while loop.
Amlan Karmakar
Greenhorn

Joined: Sep 20, 2012
Posts: 10
chets patel wrote:Get result.listIterator() outside while loop both in while condition and in first statement of while loop.


Thanks it solves my problem
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Heap Space Error due to add function