First time thru the outer loop you get the first result from that query.
The second loop then reads ALL the results from the second query.
You then get the second result from the first query and then try to read the next result from the second query but there are none left because you read them all the first time thru the outer loop.
What i think you probably want is something like

Of course this assumes both queries return the same number of results. If they don't then you will have to add some extra code to handle that situation.

You cannot have more than one opened resultset per statement. If you open another resultset on the same statement, the previously opened one will be closed.

To fix this, either merge two queries to one query (the SQL JOIN clause may be of use), or process the first resultset before opening the second, or create two independent statements. Those suggestions are in the order of recommendation.

Oh, in the future please paste the complete exception message and trace. Those are very, very important to know, because they tell exactly what the cause of the problem is and how it is happened and so this makes clear how to solve it. Otherwise others will make assumptions about the cause of the problem which may not be true at all.

I should add although this is told you more than often before, you should NOT (I repeat: NOT) write raw Java code in JSP files. It costs too MUCH time to develop, test, maintain and debug. It is simply asking for trouble for starters. Write raw Java code in a simple Java class and test/run it as a Java application using main(). This is soo much faster and easier.

Get it all to work in Java classes first. Once done that, just let a Servlet invoke those classes, store the results in the desired scope and use a JSP to display them. That's all what they ought to do.