Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Timeout: Cannot open page  RSS feed

 
Ryan Lowe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP page that is timing out. Part of the page gets loaded (roughly 30%) and then it stops processing for a few moments and then times out. No exceptions are thrown and I have configured it to NOT timeout (and have actually waited ~300 seconds for other pages in the application to load).
The confusing aspect to me is that all of the Objects are initialized first, and the rest of the application just prints out the dynamic HTML. So for some reason it is stopping in the middle of printing. Any ideas? A representative code snippet follows...
<%
Formatter f = new Formatter();
Company c = ( Company ) session.getAttribute ( "Company" );
Person[] ppl = c.getPeople();
for ( int i = 0; i < ppl.length; i++ )
{
if ( ppl [ i ].getLastName().length() != 0 &&
ppl [ i ].getLastName() != null )
{
out.print ( "<TR><TD CLASS=\"smalltext\" VALIGN=\"TOP\">" +
"<A HREF=\"/km/servlet/servlets.DisplayContact?id=" +
ppl [ i ].getId() + "\">" + ppl [ i ].getLastName() +
", " + ppl [ i ].getFirstName() + "</A></TD>" );
// Print Phone Number Information
out.print ( "<TD VALIGN=\"TOP\"><TABLE>" );
String[][] phids = ppl [ i ].getPhoneNumbers();
if ( phids != null )
{
for ( int j = 0; j < phids.length; j++ )
{
if ( phids [ j ] [ 1 ] != null )
{
out.print ( "<TR><TD CLASS=\"smalltext\" VALIGN=\"TOP\"><B>" +
phids [ j ] [ 0 ] + ": </FONT></B></TD>" +
"<TD CLASS=\"smalltext\" VALIGN=\"TOP\">" +
f.formatPhoneNumber ( phids [ j ] [ 1 ] ) +
"</TD></TR>" );
}
}
}
... etc ...
 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect some Null Pointer Exception somewhere in ur code. Sometimes these kind of exceptions will not be printed and the JSP output till that point will be flushed out to the web browser.
BTW, which JSP container are you using?
Sudharsan
 
Ryan Lowe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat. Why would a NPE not appear in my logs, though.. if that is what's happening? I have set the errorPage parameter, so typically any unhandled exception in the jsp goes straight to error.jsp...
 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rationally speaking, it should go to the error.jsp. But I had a similar problem and when i digged upon, I found an NPE was the culprit.
Sudharsan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!