java mail: set
Problem: email thread is hanging at socket read
Today we found a email problem in production, all of the mail threads (3 threads) are hanging/sitting/blocking at same point
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
- locked <0x9698d6c0> (a java.io.BufferedInputStream)
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:56)
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:757)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:673)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:168)
at javax.mail.Service.connect(Service.java:227)
at javax.mail.Service.connect(Service.java:131)
at javax.mail.Service.connect(Service.java:87)
at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:105)
- locked <0x9698d6e0> (a com.sun.mail.smtp.SMTPTransport)
at javax.mail.Transport.send0(Transport.java:162)
at javax.mail.Transport.send(Transport.java:80)
I search the "javax.mail.Transport.send" and "com.sun.mail.smtp.SMTPTransport.readServerResponse", got no hits.
while my colleague get answer from internet.
http://jira.sakaiproject.org/browse/KNL-96
http://forums.sun.com/thread.jspa?forumID=43&threadID=474662
"I have a servlet which uses JavaMail to send out emails to a smtp server. During our peak access hours, we have many requests to send out emails, after a while my application went into CLOSE WAIT accumulation and finally my application server stops processing."
"ExecuteThread: '11' for queue: 'default'" daemon prio=5 tid=0x39fb28 nid=0x18 runnable [0xbf980000..0xbf981a38]
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:85)
at java.io.BufferedInputStream.
Ïà¹ØÎĵµ£º
½«javaÏîÄ¿Éú³Éexe¿ÉÖ´ÐÐÎļþÈ«¹ý³Ì
2009Äê05ÔÂ10ÈÕ ÐÇÆÚÈÕ 16:30
Ò»¡¢Ê×ÏÈΪeclipse°²×°fatjar²å¼þ£¨Èç¹ûÄãµÄjarÏîÄ¿ÖÐÐèÒªÓõ½Í¼Æ¬¡¢Íⲿ³ÌÐòµÈÎļþʱҪÓô˲å¼þ´ò°ü³ÌÐò²ÅÄÜÕý³£ÔËÐУ©
°²×°·½Ê½ÓÐÁ½ÖÖ£º·½·¨1£ºÔÚÏß°²×°£¨ÍƼö£©
²½Ö裺
eclipse²Ëµ¥À¸ help >software updates >Find and install >Search f ......
DOMÊÇ»ùÓÚƽ̨¡¢ÓïÑÔÎ޹صĹٷ½W3C±ê×¼¡£»ùÓÚÊ÷µÄ²ã´Î£¬ÆäÓŵãÊÇ¿ÉÒÔÒÆÖ²£¬±à³ÌÈÝÒ×£¬¿ª·¢ÈËÔ±Ö»ÐèÒªµ÷Óý¨Ê÷µÄÖ¸Áî¡£ÆäȱµãÊǼÓÔØ´óÎļþ²»ÀíÏë¡£
¡¡¡¡SAXÊÇ»ùÓÚʼþÄ£Ð͵ģ¬ËüÔÚ½âÎö XML ÎĵµµÄʱºò¿ÉÒÔ´¥·¢Ò»ÏµÁеÄʼþ£¬µ±·¢ÏÖ¸ø¶¨µÄtagµÄʱºò£¬Ëü¿ÉÒÔ¼¤»îÒ»¸ö»Øµ÷·½·¨£¬¸æË߸÷½·¨Öƶ¨µÄ±êÇ©ÒѾÕÒµ½¡£ÀàËÆÓëÁ÷ýÌåµÄ½ ......
Class.forName(xxx.xx.xx) ·µ»ØµÄÊÇÒ»¸öÀà
Ê×ÏÈÄãÒªÃ÷°×ÔÚjavaÀïÃæÈκÎclass¶¼Òª×°ÔØÔÚÐéÄâ»úÉϲÅÄÜÔËÐС£Õâ¾ä»°¾ÍÊÇ×°ÔØÀàÓõÄ(ºÍnew ²»Ò»Ñù£¬Òª·ÖÇå³þ)¡£
ÖÁÓÚʲôʱºòÓã¬Äã¿ÉÒÔ¿¼ÂÇÒ»ÏÂÕâ¸öÎÊÌ⣬¸øÄãÒ»¸ö×Ö·û´®±äÁ¿£¬Ëü´ú±íÒ»¸öÀàµÄ°üÃûºÍÀàÃû£¬ÄãÔõôʵÀý»¯Ëü£¿Ö»ÓÐÄãÌáµ½µÄÕâ¸ö·½·¨ÁË£¬²»¹ýÒªÔÙ¼ÓÒ»µã¡£
A a = ......
¹ØÓÚJava
µÄµ×²ãÒ»Ö±Ïëдµãʲô£¬µ«ÊǺÃÏñºÜ¶àÎÊÌâÔÚÍøÉÏ»¹ÊÇ¿ÉÒÔÕҵõ½´ð°¸£¬×îºó»¹ÊǾö¶¨Ð´³öÀ´£¬Ò»À´¿ÉÒÔÈÃ×Ô¼ºÖØÎÂһϣ¬¶þÀ´¿ÉÒԺʹó¼ÒÒ»ÆðÉîÈë̽ÌֵײãµÄ֪ʶ¡£ÕâÀïÃ滹ÓÐһЩ³£¼ûµÄСÎÊÌ⣬Ҳ¸½´øÔÚÀïÃæµÄÔÒò£¬framework
ÆäʵҲÊǹ¹½¨ÔÚÕâЩ֪ʶµÄ»ù´¡Éϵġ£
ÂÛÒ»£ºÊýÖµÂÛ
ÎÊÌâÒ ......
ʲôÊÇsocket
³¤Á¬½ÓÓë¶ÌÁ¬½Ó
Ëùν³¤Á¬½Ó£¬Ö¸ÔÚÒ»¸öTCPÁ¬½ÓÉÏ¿ÉÒÔÁ¬Ðø·¢ËͶà¸öÊý¾Ý°ü£¬ÔÚTCPÁ¬½Ó±£³ÖÆڼ䣬Èç¹ûûÓÐÊý¾Ý°ü·¢ËÍ£¬ÐèҪ˫·½·¢¼ì²â°üÒÔά³Ö´ËÁ¬½Ó£¬Ò»°ãÐèÒª×Ô¼º×öÔÚÏßά³Ö¡£
¶ÌÁ¬½ÓÊÇָͨÐÅË«·½ÓÐÊý¾Ý½»»¥Ê±£¬¾Í½¨Á¢Ò»¸öTCPÁ¬½Ó£¬Êý¾Ý·¢ËÍÍê³Éºó£¬Ôò¶Ï¿ª´ËTCPÁ¬½Ó£¬Ò»°ãÒøÐж¼Ê¹ÓöÌÁ¬½Ó¡£
±ÈÈçht ......