Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Heap Space Error due to add function

 
Amlan Karmakar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
chets patel
Ranch Hand
Posts: 77
Eclipse IDE Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get result.listIterator() outside while loop both in while condition and in first statement of while loop.
 
Amlan Karmakar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic