When I debugged my code I found that the hasNext() method of Iterator returned true, but the next() method threw NoSuchEl
hasNext()
Iterator
true
next()
the code worked when i restarted the server and redeployed my app, so nothing was wrong with the code i guess, i cant understand this strange behavior of glassfish!