StackOverflowError
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, July 19, 2001 03:34 PM

i have an application with de javamail and the timerbean, the timer have a delay of 3 seconds, in each timerOnTime it takes one message of the INBOX of the mailhost, it runs successfully, but when the timer do it 50 times it throws the next error: Fatal error: Cannot find class java/lang/StackOverflowError it happens in "folder.close(true);" and i dont know what to do, i hope u can help me, thanks, Javier. Source: /*Aqui corre Timer1*/ void timer1OnTime(java.awt.event.ActionEvent evt) { cont += 1; System.out.println(cont); AbreMail(); try { if (totalMessages == 0) { System.out.println("Empty folder"); } else {    More>>

i have an application with de javamail and the timerbean, the timer have a delay of 3 seconds, in each timerOnTime it takes one message of the INBOX of the mailhost, it runs successfully, but when the timer do it 50 times it throws the next error:

Fatal error: Cannot find class java/lang/StackOverflowError

it happens in "folder.close(true);" and i dont know what to do, i hope u can help me, thanks, Javier.

Source:

			
/*Aqui corre Timer1*/
void timer1OnTime(java.awt.event.ActionEvent evt) {
cont += 1;
System.out.println(cont);
AbreMail();
try {
if (totalMessages == 0) {
System.out.println("Empty folder");
} else {
m = folder.getMessage(1);
pin = m.getSubject();
if (pin == null)
pin = "";
System.out.println("SUBJECT: " + pin);
try {
if (m.isMimeType("text/plain"))
mensajemail = (String)m.getContent();
else
mensajemail = "FORMATO INVALIDO";
mensajemail = mensajemail.trim();
longmens = mensajemail.length();
if (longmens > 224) {
mensajemail2 = mensajemail.substring(0,112) + " (e-www)";
mensajemail2 = analiza(mensajemail2);
EnviaPuerto(mensajemail2);
mensajemail3 = mensajemail.substring(112,224) + " (e-www)";
mensajemail3 = analiza(mensajemail3);
EnviaPuerto(mensajemail3);
} else if (longmens > 112) {
mensajemail2 = mensajemail.substring(0,112) + " (e-www)";
mensajemail2 = analiza(mensajemail2);
EnviaPuerto(mensajemail2);
mensajemail3 = mensajemail.substring(112,longmens) + " (e-www)";
mensajemail3 = analiza(mensajemail3);
EnviaPuerto(mensajemail3);
} else {
mensajemail = analiza(mensajemail);
EnviaPuerto(mensajemail);
}
} catch (IOException ioe) {System.out.println("Error IO " + ioe);}
m.setFlag(Flags.Flag.DELETED, true);
}
} catch (MessagingException me) {System.out.println("Error Msg" + me);}
CierraMail();
}
/*Fin de Timer1*/

/*Aqui conecta Mail*/
void ConectaMail() {
props = System.getProperties();
session = Session.getDefaultInstance(props, null);
try {
store = session.getStore("pop3");
} catch (NoSuchProviderException nspe) {System.out.println("Error protocolo " + nspe);}
try {
store.connect("172.16.24.3" , 110, "javier", "javier");
folder = store.getDefaultFolder();
folder = folder.getFolder("INBOX");
} catch (MessagingException me) {System.out.println("Error Msg " + me);}
}
/*Fin de Conecta Mail*/

/*Aqui abre el correo*/
void AbreMail() {
try {
folder.open(Folder.READ_WRITE);
totalMessages = folder.getMessageCount();
} catch (MessagingException me) {System.out.println("Error Msg " + me);}
}
/*Fin de abre el correo*/

/*Aqui cierra el correo*/
void CierraMail() {
try {
folder.close(true);
} catch (MessagingException me) {System.out.println("Error msg " + me);}
}
/*Fin de cierra el correo*/
   <<Less
About | Sitemap | Contact