Is there any problem to use multiple threads to send email with JavaMail

Dear all,
I am using JavaMail 1.3.2 to send emails with SMTP, it works very well for a long time.
But one day, I found that the email service hanged and I could never send email again until I restart the tomcat. I found that the reason was a deadlock had been created, the required resource for sending email had not been released.
I guess the error is due to multiple threads are sending email at the same time. I made a test to create seperate thread for sending each email. After few days, I found this deadlock happened again. So, my question is: Can I use JavaMail with multiple threads? If not, I may need to sychronized all the thread that using JavaMail. I would like to make sure this is the reason for causing the deadlock problem.
Here is part of my code for using JavaMail:
transport = session.getTransport("smtp");
transport.connect(email_host, smtp_user, smtp_pass);
message.saveChanges();
transport.sendMessage(message,message.getAllRecipients());
which is very standard call, and it worked well for a long time.
Here is part for my thread dump on tomcat:
(Thread-339)
- waiting to lock <0x5447c180> (a sun.nio.cs.StandardCharsets)
(Thread-342)
- locked <0x5447c180> (a sun.nio.cs.StandardCharsets)
It seems that these happened after call the method transport.sendMessage() or message.updateChanges()
, and the underlying implementation may require the JRE StandardCharsets object. But the object had been locked and never be released. So, the sendMessage() or updateChanges() can't be completed.
Please give me some helps if you have any idea about it.
Thanks very much!
Sirius

Note that the Nightly build gets updated daily (and sometimes more than once in case of a respin) and it is always possible that something goes wrong and it doesn't work properly, so be prepared for issues if you decide to stay with the Nightly build and make sure to have the current release with its own profile installed as well in case of problems.
See also:
* http://kb.mozillazine.org/Testing_pre-release_versions
*http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
*http://kb.mozillazine.org/Shortcut_to_a_specific_profile
*http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

Similar Messages

  • Can I use DeliveryManager just to send email with no document?

    Can I use "oracle.apps.xdo.delivery.DeliveryManager" to just send email without any document attached? or
    Is this only used to deliver the documents by email?
    I just want to use DeliveryManager just to send email with content in the body of the email. I am using BI Publisher API.
    Can any of you provide sample input for the above?

    Hi,
    You can use iMovie to record the message and save it as an email sized item and send the file as email like before.
    For those iChat AV users without a Cam and the AIM users without a cam you can do One-Way Viedo chats.
    Once you have a recorded Video file you can also drop the file on any Buddies name in you iChat Buddy list rather than using email.
    For those using other services you can set up a Jabber account and enable the required Transport/Gateways and send the files that way.
    http://www.jabber.org.au/ichat = Australian Page
    AllForces
    These are the two main information pages on how iChat can connect to the other IM services.
    Jabber Public Server list
    That would appear to be everybody.
    Ralph

  • ¿Is there any problem to use Nightly version of Firefox as default browser?

    I am testing the Australis theme of Firefox and I like it so much that I want to use it as my default browser, instead of the Firefox stable version.
    Is there any problem related to security with doing that? I know this version isn't stable at all, but this does not matter for me right now.
    Thank you very much! :)

    Note that the Nightly build gets updated daily (and sometimes more than once in case of a respin) and it is always possible that something goes wrong and it doesn't work properly, so be prepared for issues if you decide to stay with the Nightly build and make sure to have the current release with its own profile installed as well in case of problems.
    See also:
    * http://kb.mozillazine.org/Testing_pre-release_versions
    *http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    *http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    *http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • HT3702 Is there any way to use a pre-paid Visa card with my iTunes account?

    I just received a prepaid Visa card as a gift and tried to use this card as payment info on my iTunes account.  This didn't work, I suspect because there is no billing address associated with the card.  Is there any way to use the card like this?  Any help would be greatly appreciated.

    jkhitunes wrote:
    Wonder why an Apple person told me this would work??
    Apple should read this stuff once in a while.
    Some prepaid cards appear to act as credit cards to the merchant. If yours is one of them it should work, but debit cards are not accepted for the iTunes Store.
    Can you use a pre-paid credit card from Wal-Mart?
    Do you mean an iTunes Card, the kind sold at Wal-Mart? Sure, that will work.
    "Pre-paid" and "credit" are mutually exclusive.
    I believe this way of thinking about it ought to be valid: if you need a PIN code, the card won't work.
    I don't use debit cards so I can't be certain if this will apply consistently, but let me know if that makes sense.

  • Are there any problems of using Connections other then HTTPConnectoin?

    Hi,
    I have tried to use datagram connection with the following code:
    DatagramConnection c = (DatagramConnection) Connector.open("datagram://localhost:10000");
    when i use the midp to test it, it gives out error message like:
    javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist datagram://localhost:10000
    Am i missed to setup some things?
    P.S. I am using midp and cldc version 1.0.3 and palm emulator

    the midp specification (http://java.sun.com/j2me/docs)says that only http-connection is mandatory, kvms and devices can provide the other connection types specified too.
    the reason for this is that http is the only protocol of the given, that runs on a certain level of abstarction.
    So device manufactors are not bound to a physical protocol such datagram/socket connection. How http transmissions happens depends on the kvm and the device specs.
    If you develop for a certain product category, where you know that the devices all implement datagram transmission you can do it, otherwise its recommendet do use only HTTP.
    MIDP for Palm does not implement a datagram protocol actually (http://java.sun.com/products/midp4palm/faq.html#Q5)

  • Is there any information about using iCloud on a Mac with multiple user accounts (Mountain Lion)

    When upgrading to Mountain Lion, you are asked to sign in using your iCloud ID.  I don't understand how to set up the proper synching of "stuff" if your Mac has multiple user accounts, and they each have their own iCloud ID.
    The whole issue of supporting multiple users on a Mac and making everything easy to understand with regard to iTunes and iCloud is, in my opinion, currently in a state of disaster.  Apple needs to address this.  They have conveniently made it a non-issue on iPads by not allowing multiple users.  I can tell you that as one of the resident iOS and Apple experts in my office, most of the questions I get from others (not work-related) are on this topic.  It needs to be easier to understand and accomplish.
    Thanks in advance for any information you have on this subject.

    CS7981 wrote:
    is "Is there any benefit to using my Airport Express with my wireless router
    no.

  • Are there any problems using a back cover.

    I want to protect the back of my iPad from scratches. Are there any problems using a skin or cover on the back?

    Is it  ok to cover the back of iPad 2? Won't it affect the cooling system? Coz I don't see any ventilation point and it may be the back metal plate itself which brings out the heat. I purchased a "Targus" back cover from apple store and it fits perfectly and beautifully also very comfortable to handle but I removed it thinking that it might harm., also Apple hasn't introduced any sort of back cover either, only the smart cover for the screen they have, may be coz the back is designed to be open to the air.

  • Are there any problems using an ipad imported to the UK from korea?

    Are there any problems buying an Ipad in South Korea to use in the UK?

    Me too - its a possible gift and (like most things) iPhones are cheaper in the states than in Canada.  
    I'm assuiming these phones are universal.  But i'd rather know before buying. 
    Thanks

  • Using apple iphone 5, i observe today that display shows yellow border when i choose option in setting as erase all content and setting, iphone goes in to starting mode, i want to know is there any problem to display, plz give me feed back urgently

    using apple iphone 5, i observe today that display shows yellow border when i choose option in setting as erase all content and setting, iphone goes in to starting mode, i want to know is there any problem to display, plz give me feed back urgently

    I had this same thing happen to me.  I was using my brand new iphone 5 (texting and listening to music through the speakers) when it flashed the apple logo, stopped my music and brought me to the lock screen. 

  • Is there any way to use -useLegacyAOT option in FlashBuilder 4.6?

    I need to build my ipa with old version of Engine because i have some problems about loading images from outside. Since with Air 15 it is default engine, and i cannot quit Air 15 because of the iTunes specs. I cannot add -useLegacyAOT=yes to compiler options on Adobe Flash Builder 4.6 because it seems that it can be added at FB4.7.
    So is there any way to add this options when i am using FB4.6
    Thanks in advance.

    DeepakJ wrote:
    Hi,
    Is there any way to use a control break on Dept column in a SQL query to have a Output-2 instead of Output-1.
    Is there any way to modify the SQL query.
    SQL
    select dept, loc, count(*)
    from dept
    group by dept, locOutput-1
    Dept      Loc       Count(*)
    10         AA        1
    10         BB        2
    10         CC        2
    20         AA        2
    20         BB        2Output-2
    Dept      Loc       Count(*)
    10         AA        1
    BB        2
    CC        2
    20         AA        2
    BB        2
    Yes, using the <tt>lag</tt> analytic function and specified ordering of the data:
    select
        nullif(d.deptno, lag(d.deptno) over (order by d.deptno, d.loc, e.mgr nulls first)) deptno
      , nullif(d.loc, lag(d.loc) over (order by d.deptno, d.loc, e.mgr nulls first)) loc
      , e.mgr
      , count(*) n
    from
        dept d
          join emp e
            on d.deptno = e.deptno
    group by
        d.deptno
      , d.loc
      , e.mgr
    order by
        d.deptno
      , d.loc
      , e.mgr nulls first;
    DEPTNO  LOC       MGR   N
        10  NEW YORK         1
                      7782   1
                      7839   1
        20  DALLAS    7566   2
                      7788   1
                      7839   1
        30  CHICAGO   7698   4
                      7839   1
        40  BOSTON    7698   2
                      7902   1

  • After installing the new Yosemite OS on my iMac I can no longer send email. I can receive email, but not send. I use gmail and can send email on the gmail (google) site, but not on "mail" on my iMac. Any others with this problem? What should we do?

    After installing the new Yosemite OS on my iMac I can no longer send email. I can receive email, but not send. I use gmail and can send email on the gmail (google) site, but not on "mail" on my iMac. Any others with this problem? What should we do?

    My gmail, which is correctly configured for Mail with gmail SMTP and Google IMAP, works for awhile on Mail, which I leave open while working on other applications. But several times a day I get msg from Google: "We recently blocked a sign-in attempt to your Google Account" . . . and requiring me to verify my account details, re-enter passwords, confirm security settings (or change them from "disable" to "enable less secure methods" and so on). In Mail I also have tried "taking all accounts online", and re-entering my gmail password inside Mail account settings. These steps successfully re-set comms between gmail and Mail ... for awhile, then it happens again. Enough occurrences over a work day that I just quit Mail and revert to accessing gmail directly. Apple Care advisor and an Apple knowledge base article say that Apple can't deal with this, as gmail is third-party app, and they refer me to gmail, and so far I've found nothing helpful there.
    From today I also have several instances of a window saying "Mail has unexpectedly closed" and asking me to Re-open it.
    I also use Yahoo mail, which stops working with Mac Mail at the same time as gmail, but I do not receive notices to re-verify from Yahoo.
    I recently upgraded from Mavericks to Yosemite. The Mail problem happened occasionally with Mavericks but is far more frequent with Yosemite.

  • Are there any problems with Snow Leopard Server (Xserve) and PPC Clients

    Hi,
    are there any problems identified yet with Snow Leopard Server, installed on a Xserve and PPC Clients running Mac OS X Tiger and Leopard?
    Currently I have a Xserve Intel running Leopard Server and about 12 Mac Minis PPC running Mac OS X Tiger and Mac OS X Leopard. The Xserve serves services like DNS, OpenDirectory, Software Update Server, NetBoot, etc. All users have Home Directories stored on the Xserve.
    Now I want to install Snow Leoaprd Server on the Xserve, but I wonder if there are any problems using the PPC Clients? I have read something like this on a german website.
    Thanks!

    We've actually found that the Server 10.6.3 DVD does an amazingly smooth job of upgrading 10.5.8. We've been upgrading our production servers and nothing has gone wrong yet. Snow Leopard employs an archive and install method of upgrading which results in an install which is very close to a clean install. So it's been very convenient for us because our servers are used as Windows PDCs and it's a pain in the *** to have to re-join all PCs to the domain if we start from scratch.

  • Are there any problems with motion menus and buttons in DVDSP 2 on OS 10.4?

    I have not used DVD Studio Pro 2 since upgrading to Tiger but it appears to no longer be showing moving motion on menus and buttons.
    Are there any problems that I should be aware of when using DVDSP2 on OS 10.4?
    I have not upgrade to a newer version only because I do not have any HD software to create DVDs.
    Thanks
    Paul

    New Discussions ReponsesThe new system for discussions asks that after you mark your question as Answered, you take the time to mark any posts that have aided you with the tag and he post that provided your answer with the
    tag. This not only gives points to the posters, but points anyone
    searching for answers to similar problems to the proper posts.
    If we use the forums properly they will work well...

  • Is there any problem after buying ipod touch?

    guys I am going to buy an Ipod touch now in April I have a question that is there any problem after I take a new ipod touch or will I get any lag using it and plz tell me which storage size should I take as my usage is four to 5 games, itunes u,50 songsand some movies?????

    At least 32GB, as with any new electronic device, get the most advanced you can afford, you can't add any more space or features after you bought the device.

  • Is there any method to use network printer without installing driver?

    We have some embeded win7 devices which we cannot install drivers to.
    Is there any method to use network printer without installing driver?

    Hi,
    Please read the following article:
       http://en.wikipedia.org/wiki/Device_driver
    You definitely need this middle man.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

Maybe you are looking for

  • Swf does not load flv on server

    This has been asked before but it doesn't appear to have been answered... On my local workstations the swf loads and runs the flv fine. They are both in the same directory. When I upload the pair to a server (windows 2003) the swf no longer loads the

  • Has apple stopped Raw compatibility updates??

    I Just looked at all of the raw updates over the past year.  Shortest time between updates.... 3 weeks,  longest time 9 weeks, average, 6.3 weeks.  Time since last update 10 weeks. i Have brought this up in other forums and people are saying either A

  • Multicast address inside a solaris zone buggy ?

    I need to post to a multicast address from within a solaris 10 (06.06) zone but the routing is abnormal: On the global: 224.0.0.0 240.0.0.0 172.16.248.42 e1000g0 1500* 0 1 U 0 0 Inside the zone: 224.0.0.0 240.0.0.0 172.16.0.60 e1000g32001:1 1500* 0 1

  • Office 2010 Asset Inventory not visible

    We are rolling out Office 2010. The Asset Inventory does not appear to be picking up any of these. Is the a PRU update including the latest MS Office 2010 products.

  • ITunes sends me in a giant loop when I try to restore my iPod.

    I am VERY annoyed. When I plug in my iPod, it either says that it is corrupted or that iTunes has found a problem and that I must restore it to the factory settings. So I restore the iPod and it says it's working and I get to a window saying that I n