• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JasperException error help (exception report)

 
gun wiyono
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am using tomcat 6.0.14 trying to compile a JSP and I keep getting an exception report. I am fairly new to web development and am kinda lost with this error.
I have called and closed with the useBean, but i am not understanding this exception error report problem.
Here is the code telling the jsp to call this line as a link to another page called "watersystemfacility.jsp" hyperlinked with a column in a db called "st_asgn_ident_cd"



and this is the exception error that i get...



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1: Refactor your JSP, removing the Java code completely and putting it into a controller or bean. The time to be putting Java code into a JSP ended around 2002...
 
gun wiyono
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But from this type of error, can you tell right away which part is wrong? The java or the html part is causing these errors.

I have been refactoring all of my tables that pulls from the sql db, just haven't thought about refactoring all of the java completely out of the JSP file.
 
dileep keely
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are calling empty result set.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML doesn't throw errors. It's obviously a JDBC problem.

The error message:
javax.servlet.ServletException: com.microsoft.sqlserver.jdbc.SQLServerException: The result set has no current row.

indicates a logic error in iterating over the result set.

This would be much easier to debug were the code in a Java class rather than a JSP.

Since this isn;t a JSP issue, it's been moved to the JDBC forum.
 
gun wiyono
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright ,that makes more sense. I'll look into the DB or the JDBC connection, thanks!
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could not find the closing } in your while loop. Seems that you are closing the ResultSet (rs_wsf.getStatement().close(); ) within the loop.
 
gun wiyono
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I have the closing while loop bracket later on in the code. I have checked the database and the data is there, but I don't know why it isn't calling it...or it's saying that the result set is empty.

Maybe it's an error with the class I am using where I call all of the data from the db itself.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gun wiyono wrote:Oh, I have the closing while loop bracket later on in the code. ...
Well, that is your issue I think. rs_wsf.getStatement().close(); should go after the closing of the while.
 
gun wiyono
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, I think you're right on this one. I started having this problem after I started messing with the placement of my loops. I was trying to do a loop inside a loop for a table within a table, similar to an implicit if statement.

Thanks for the tips!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic