Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 3.2.1 keeps crashing

 
hemanth kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to everybody
I am an ASP programmer learning JSP.This is my first question in this forum.
Well my problem is Tomcat(ver 3.2.1) keeps crashing quite frequently.Platform is Win 95, Db is MS Access 97
For ex here is a portion of the code where the Tomcat crashes
rs=stmt.executeQuery("select * from users where vUsername='"+ sUid +"' and vPassword='" + sPwd +"'");
try
{
if (rs != null)
{
HttpSession sess=request.getSession();
sess.setAttribute("UserID",sUid);
String sUnivCode=rs.getString("vUserName");
sess.setAttribute("UnivCode",sUnivCode);
out.println("Welcome "+ sUnivCode);
}
}
catch(SQLException e)
{
out.println("Something wrong with ur query");
}
In this code if i give rs != null the Tomcat just bonks out.I checked out an JSP book and this is the syntax that they give.
Anybody has a clue abt what is going on??
Thnx and regds
Hemanth
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hemanth:
Welcome to the ranch. Hope you like it.
Now re your problem, could you give us some clue
as to what exception you get?
Did you take a look at logs/tomcat.log for any errors?
Let us know.
regds.
- satya
 
hemanth kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I searched the Tomcat/log directory.There is no file called Tomcat.log.Only 2 other files jasper.log and servlet.log are present.
Regarding error message, it is the usual windows Illegal Operation error. Nothing comes on the MS Dos prompt window also.
Also i substituted "if (rs != null)" with "if (rs.next())" then it is working fine.BUT now when i try to redirect the page using response.sendRedirect("somepage.jsp") the server again bonks out.
What might be the error?.Does Tomcat 3.2.1 support Win 95 plaf.?
Should i try reinstalling Tomcat.
Regds
Hemanth
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I would be inclined to verify that the DB stuff works
as expected, by writing a small application (move the
JDBC calls to a new java file and add a main() method).
i would execute this verify that there is nothing wrong
with the JDBC calls and then worry about tomcat.
My $0.02.
regds.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic