My servlet stops in a cycle ! Why?

P

pincopallo_it

Hi
Got a big problem with this servlet
In one of the cycles suddenly it stops with not apparent reason


this is the code:

try
{

FileOutputStream fileoutputstream = new
FileOutputStream(path + "NHOOOLF01.html");
out = new PrintWriter(fileoutputstream);
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
TRANSITIONAL//EN\">");
out.println("<HTML>");
out.println("<HEAD>");
out.println("<title>SIAS</title>" );
out.println("<meta http-equiv=\"Content-Type\"
content=\"text/html; charset=iso-8859-1\">" );
out.println("<meta http-equiv=\"Pragma\"
content=\"no-cache\">" );
out.println("<meta http-equiv=\"Cache-Control\"
content=\"no-cache\">" );
out.println("<link href=\"css/dinamic.css\"
rel=\"stylesheet\" type=\"text/css\">");
out.println("</HEAD>");

out.println("<BODY>");
out.println("<table id=\"tab-sfondo\" cellPadding=\"0\"
cellSpacing=\"0\">");
out.println("<tr>");
out.println("<td class = \"td-navigazione\"> <a
href=\"home.htm\" target=\"_parent\"");
out.println(" class = \"link-navigazione\"> Home <a
href=\"coo_ioni.htm\"");
out.println(" class = \"link-navigazione\"> Presight </a>
&gt; <a href=\"corpo_teiche.htm\"");
out.println(" class = \"link-navigazione\"> Pappe </a> &gt;
10km trrio </td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td class = \"td-tab-1\"> <table cellspacing
=\"0\" cellPadding=\"0\">");
out.println("<tr>");
out.println("<td class = \"td-help\"> <a
href=\"Help.html\"");
out.println(" class = \"link-color-2\"> Modellismo
</a></td>");
out.println("<td><table cellPadding=\"1\"
cellSpacing=\"1\" id=\"tabella-prev\">");
out.println("<tr>");
out.println("<td class = \"td-altra-cella-center\">
<strong>Previ giche");
out.println("modlo - Mpe Trie </strong></td>");
out.println("</tr>");
out.println("</table></td>");
out.println("</tr>");
out.println("</table></td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td class = \"td-tab-1\"> <table cellspacing
=\"1\" cellPadding=\"1\" id=\"tabella-1\">");
out.println( said:
&nbsp;</td>");
out.println("<td colspan=\"4\"");
out.println(" class = \"td-prima-cella\">"+ s1 + "<br>" +
s2 + "<br> ore </td>");
out.println("<td colspan=\"4\"");
out.println(" class = \"td-prima-cella\">"+ s4 + "<br>" +
s5 + "<br> ore </td>");
out.println("<td colspan=\"4\"");
out.println(" class = \"td-prima-cella\">"+ s7 + "<br>" +
s8 + "<br> ore </td>");
out.println("</tr>");
out.println("<tr>");






out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td> "+ as1[0][1] + "</td>");
out.println("<td align =\"right\" <img border=\"0\"");
out.println("src=\"images/" + as1[0][2] + "\"></td>");
out.println("</tr>");
out.println("</table></td>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 03.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 09.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 15.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 21.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");

for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 06.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 12.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 18.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 24.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\"
class=\"td-prima-cella-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("</tr>");
out.println("<tr>");

out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td> "+ as1[1][1] + "</td>");
out.println("<td align =\"right\" <img border=\"0\"");
out.println("src=\"images/" + as1[1][2] + "\"></td>");
out.println("</tr>");
out.println("</table>");
out.println("</td>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 03.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 09.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 15.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 21.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");

for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 06.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 12.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 18.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 24.00 </a></td>" );

}

out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\"
class=\"td-prima-cella-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("</tr>");
out.println("<tr>");

out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td> "+ as1[2][1] + "</td>");
out.println("<td align =\"right\" <img border=\"0\"");
out.println("src=\"images/" + as1[2][2] + "\"></td>");
out.println("</tr>");
out.println("</table>");
out.println("</td>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 03.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 09.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 15.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 21.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");

for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 06.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 12.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 18.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 24.00 </a></td>" );

}

out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\"
class=\"td-prima-cella-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("</tr>");
out.println("<tr>");

out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td>");
out.println("<td> "+ as1[3][1] + "</td>");
out.println("<td align =\"right\" <img border=\"0\"");
out.println("src=\"images/" + as1[3][2] + "\"></td>");
out.println("</tr>");
out.println("</table>");
out.println("</td>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 03.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 09.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 15.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 21.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 06.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 12.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 18.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 24.00 </a></td>" );

}

out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\"
class=\"td-prima-cella-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td>");

out.println("<td width=\"200\" rowspan=\"2\" class
=\"td-prima-cella\"> <table width=\"100%\"");
out.println(" class = \"td-prima-cella-left\">");
out.println("<tr>");
out.println("<td>");
out.println("<td> "+ as1[4][1] + "</td>");
out.println("<td align =\"right\" <img border=\"0\"");
out.println("src=\"images/" + as1[4][2] + "\"></td>");
out.println("</tr>");
out.println("</table>");
out.println("</td>");
for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 03.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 09.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 15.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 21.00 </a></td>" );

}
out.println("</tr>");
out.println("<tr>");

for(int k = 0; k < 4; k++)
{
out.println("<td class = \"td-cella-link-prev\">
<a href =\"" + as1[k][0] + "\" class = \"link-color-1\"> 06.00
</a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 12.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 18.00 </a></td>" );
out.println("<td class = \"td-cella-link-prev\"> <a href =\"" +
as1[k][0] + "\" class = \"link-color-1\"> 24.00 </a></td>" );

}

out.println("</tr>");
out.println("<tr>");
out.println("<td width=\"200\"
class=\"td-prima-cella-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("<td colspan=\"4\"
class=\"td-cella-link-vuota\">&nbsp;</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td align=\"center\" valign=\"middle\"
class=\"td-etto\"> <img ");
out.println("src=\"images/tto.png\" width=\"775\"
heigth=\"1\" </td>");
out.println("</tr>");
out.println("</table>");
out.println("</body>");
out.println("</html>");

}

and this is the end of the output ... when it stops not completing the
html
any idea?
Thanks Gianni

<td class = "td-cella-link-prev"> <a href ="6100" class =
"link-color-1"> 06.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6100" class =
"link-color-1"> 12.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6100" class =
"link-color-1"> 18.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6100" class =
"link-color-1"> 24.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6150" class =
"link-color-1"> 06.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6150" class =
"link-color-1"> 12.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6150" class =
"link-color-1"> 18.00 </a></td>
<td class = "td-cella-link-prev"> <a href ="6150" cl
 
A

Andrew Thompson

Got a big problem with this servlet
In one of the cycles suddenly it stops with not apparent reason

this is the code:

Do you swallow stacktraces?
<http://www.physci.org/codes/javafaq.jsp#stacktrace>
It is not evident from the (356 line!) snippet you supplied.

OTOH
try
{

FileOutputStream fileoutputstream = new
FileOutputStream(path + "NHOOOLF01.html");
out = new PrintWriter(fileoutputstream);
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
TRANSITIONAL//EN\">"); ........

out.flush();
out.close();

}

HTH
 
P

pincopallo_it

catch(Exception exception)
{
System.out.println("ERRORE NHEOWLF01.html: KO");
exception.printStackTrace();
}
forgot to add this....
courious thing ...
if I reduce the number of the html lines cycle go further ... but never
finish !!!
is there a number of max lines? I suppose not !
thanks
 
P

pincopallo_it

out.flush();
out.close();

When i closed the file it worked
Thanks Andrew
ciao
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,704
Messages
2,569,334
Members
44,617
Latest member
ConcettaTa

Latest Threads

Top