From owner-freebsd-java Thu May 2 11:16:28 2002 Delivered-To: freebsd-java@freebsd.org Received: from nwkea-mail-1.sun.com (nwkea-mail-1.sun.com [192.18.42.13]) by hub.freebsd.org (Postfix) with ESMTP id 3506F37B438; Thu, 2 May 2002 11:16:07 -0700 (PDT) Received: from ha2sca-mail1.SFBay.Sun.COM ([129.145.155.62]) by nwkea-mail-1.sun.com (8.9.3+Sun/8.9.3) with ESMTP id LAA07068; Thu, 2 May 2002 11:16:06 -0700 (PDT) Received: from ranman (vpn-129-149-241-3 [129.149.241.3]) by ha2sca-mail1.SFBay.Sun.COM (8.10.2+Sun/8.10.2/ENSMAIL,v2.1p1) with ESMTP id g42IFv016218; Thu, 2 May 2002 11:15:58 -0700 (PDT) Date: Thu, 2 May 2002 11:15:58 -0700 (PDT) Message-ID: <12866987.1020363127191.JavaMail.Administrator@ha2sca-mail1.sfbay.sun.com> From: Ranjith Mandala To: freebsd-java@freebsd.org Subject: Re: (Review ID: 145816) Java Mail api cause the JVM to stop the operation and the program killed. Cc: java-port@freebsd.org, Ranjith.Mandala@Sun.COM Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: postEmail @(#) PostEmail.java 1.14 00/01/27 10:09:23 X-IM-Review-ID: 145816 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi Avinash K S Holla, This Bug Report was submitted from http://java.sun.com/cgi-bin/bugreport.cgi and is being forwarded to you on behalf of avinashks@oyeindia.com. If you would like to respond. Please send an e-mail to the address listed at the end of this report. Regards, RM. ----------------- Original Bug Report------------------- category : hotspot release : 1.4 subcategory : other type : bug synopsis : Java Mail api cause the JVM to stop the operation and the program killed. description : FULL PRODUCT VERSION : java version "1.4.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0- b92) Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode) FULL OPERATING SYSTEM VERSION : FreeBSD 4.5-STABLE FreeBSD 4.5-STABLE #0: Thu Mar 14 17:20:01 IST 2002 A DESCRIPTION OF THE PROBLEM : I have a list of users with their password in two separate array and I login to the pop3 server with this information. My main objective is to fetch the UID of the messages and then to alert the user of the arrival of new messages after comparing with thier old UIDs I will get the proper result if the number of users is less that 50 and as soon as I cross, JVM sarts to throw the error and stops the program from running. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Have a list of pop users in an array (Ex: above 75) 2. Using a loop check for the UID of the messages 3. Compare the previous UIDs with the current iteration and write the number of new message(s)for that user in a hashtable or file for further processing. EXPECTED VERSUS ACTUAL BEHAVIOR : The expected result is filling up of the hashtable with the number of new messages.. But the JVM repeatedly throws up the error and my program stops ERROR MESSAGES/STACK TRACES THAT OCCUR : DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc] POP3: connecting to host "10.0.3.240", port 110 S: +OK POP3 blrmail.bplmail.com v7.64 server ready C: USER avinash.ks S: +OK User name accepted, password please C: PASS welcome123 S: +OK Mailbox open, 0 messages C: STAT S: +OK 0 0 C: QUIT S: +OK Sayonara DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc] POP3: connecting to host "10.0.3.240", port 110 S: EOF DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc] POP3: connecting to host "10.0.3.240", port 110 Connect failed; nested exception is: java.net.ConnectException: Connection refused javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection refused at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:106) at javax.mail.Service.connect(Service.java:234) at javax.mail.Service.connect(Service.java:135) at CheckMail.run(CheckMail.java:206) Starting to check at 24-04-2002 AD at 02:44:39 PM IST DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc] POP3: connecting to host "10.0.3.240", port 110 Unexpected Signal : 11 occurred at PC=0x2A0377B7 Function=[Unknown.] Library=(N/A) NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: Dynamic libraries: Can not get information for pid = 58311 Local Time = Wed Apr 24 14:44:59 2002 Elapsed Time = 157 # # HotSpot Virtual Machine Error : 11 # Error ID : 4F530E43505002D3 # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.0-b92 mixed mode) # # An error report file has been saved as hs_err_pid58311.log. # Please refer to the file for further information. This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public void checkPop3(Folder folder, String user) { boolean flagPop3 = false; POP3Folder pf = null; File file = null; RandomAccessFile raf = null; Vector newMsgId = null; Vector oldMsgId = null; int newMsgCnt = 0; newMsgId = new Vector(); oldMsgId = new Vector(); try { // try to open read/write and if that fails try read-only try { folder.open(Folder.READ_WRITE); } catch (MessagingException ex) { folder.open(Folder.READ_ONLY); } int totalMessages = folder.getMessageCount(); if (totalMessages == 0) { folder.close(false); // store.close(); return; } // Attributes & Flags for ALL messages .. Message[] msgs = folder.getMessages(); // Use a suitable FetchProfile FetchProfile fp = new FetchProfile(); fp.add(UIDFolder.FetchProfileItem.UID); folder.fetch(msgs, fp); if (folder instanceof com.sun.mail.pop3.POP3Folder) { flagPop3 = true; pf = (com.sun.mail.pop3.POP3Folder)folder; } else { flagPop3 = false; } for (int j = 0; j < msgs.length; j++) { if(flagPop3) { String uid = pf.getUID(msgs[j]); newMsgId.add(uid); } else { String messageId = msgs[j].getHeader("Message-Id")[0]; newMsgId.add(messageId); } } file = new File(user + ".msgid"); raf = new RandomAccessFile(file, "rw"); String readLine = ""; while(true) { try { readLine = raf.readUTF(); oldMsgId.add(readLine); } catch(EOFException eofe) { break; } } for(int j=0; j 0 ) { System.out.println("No of new msgs " + newMsgCnt); } raf.seek(0); for(int j=0; j