Problem in connect to a store

I use JavaMail1.3.2 to connect a pop3 store and receive mails. It seemed works OK in first 1 or 8 hours, and after, the process will halt at store.connect step or store.isConnected step,
For example:
while(true){
Log4J.getLogger().debug("Try to connect "+ userName + "'s store!");
while(!store.isConnected()){
try{
Log4J.getLogger().debug("Connect "+ userName + " store...");
store.connect();
Log4J.getLogger().debug("Connect to MailBox:"+ userName + " store OK!");
folder = store.getFolder(folderName);
Log4J.getLogger().debug("Got "+ userName + "'s folder OK!");
}catch(Exception e){
Log4J.getLogger().error("Connect to Mailbox:"+ userName + " store error:" + e.getMessage());
try {
Log4J.getLogger().info("Waite " + frequency/60000 + "minutes!");
Thread.sleep(frequency);
} catch (InterruptedException e1) {
Log4J.getLogger().error("Thread error:"+e1.getMessage());
try {
Log4J.getLogger().debug("Try to open "+ userName + "'s folder!");

While running some time, log will stop at �Try to connect username�s store� and no exception or other information output.
I've set           pro.put("mail.pop3.connectiontimeout",timeoutVal);
          pro.put("mail.pop3.timeout",timeoutVal);
and seemed it doesn't work.
Please help me, How does this happen and how to solve it? Thank you very much!

Hello,
I get exactly the same issue in my app :
I have a mail receiver class that looks like that :
public static Message[] receiveMessages()
          Message[] msgs = new Message[0];
          try
               log.info("Checking mail on "+CommProperties.getInstance().getPopHost()+"...");
               if(null==folder||!store.isConnected())
                    log.debug("Folder is null or store is not connected, reinitialization");
                    // -- Try to get hold of the default folder --
                    folder = getStore().getDefaultFolder();
                    if (folder == null) throw new Exception("No default folder");
                    log.debug("Getting INBOX");
                    // -- ...and its INBOX --
                    folder = folder.getFolder("INBOX");
                    if (folder == null) throw new Exception("No POP3 INBOX");
               log.debug("Open folder for R/W");
               // -- Open the folder for read-write --
               folder.open(Folder.READ_WRITE);
               log.debug("Getting messages");
               // -- Get the message wrappers and process them --
               msgs = folder.getMessages();
               if(msgs.length==0)
                    log.debug("...No new mail in INBOX");
               log.debug("End");
          catch (Exception ex)
               log.error("Error while retrieving messages",ex);
          return msgs;
public static Store getStore() {
          if(null==store || !store.isConnected())
               try
                    if(store!=null)
                         log.debug("Store not connected : closing");
                         store.close();
                    log.debug("Getting pop3 Store");
                    store = getSession().getStore("pop3");
                    log.debug("Connectting pop3 Store");
                    store.connect(CommProperties.getInstance().getPopHost(), CommProperties.getInstance().getPopUsername(), CommProperties.getInstance().getPopPassword());
               catch(Exception ex)
                    log.error("Error while getting store",ex);
          return store;
In this case one session and folder are created. The class detects when a disconnection appears and is able to reconnect.
This method is called using a jboss service set to run one time a minute.
When deployed, the receive process runs up to 15 days without interruption. I see in the logs that sometimes, folder gets disconnected and is then reconnected without problem.
However, after 15 days (sometimes more, sometimes less), the app suddenly freezes after 'log.info("Checking mail on "+CommProperties.getInstance().getPopHost()+"...");'
So the freeze is due to the "store.isConnected()" not responding...
Unfortunately, i haven't got any solution. I tried several connect processes (connect/disconnect folder and session each time, reconnect folder each time...) but nothing seems to impact the issue.
So, guys, any help is very welcome! :-)
Thanks
Stephane

Similar Messages

  • Problem in connecting to mail store - please help me

    i have developed a mail user agent using javamail api.
    im having some problem in connecting to mail store
    it is giving MessagingException.
    the snippet is :
    store=session.getStore(url);
    try
    if(store.isConnected())
    store.close();
    store.connect();
    catch(MessagingException mexception)
    System.out.println("messaging exception store state -
    "+store.isConnected());
    //exception is raised and isConnected is false.
    --================--
    thanQ in advance
    prabhakar

    Dear tus,
    thanQ for ur suggession. i have printed stacktrace and im getting the following the exception
    please help me
    javax.mail.MessagingException: null;
    nested exception is:
    java.io.IOException
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:298)
    at javax.mail.Service.connect(Service.java:234)
    at javax.mail.Service.connect(Service.java:135)
    at javax.mail.Service.connect(Service.java:87)
    at sark.mail.MailStoreImpl.createSession(MailStoreImpl.java:356)
    at sark.mail.MailStoreImpl.fetchMails(MailStoreImpl.java:210)
    at org.apache.jsp.checkLogin$jsp._jspService(checkLogin$jsp.java:121)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServlet
    Wrapper.service(IDEJspServlet.java:174)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJsp
    File(IDEJspServlet.java:247)
    at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(ID
    EJspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
    atcher.java:679)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
    ispatcher.java:431)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
    patcher.java:355)
    at mailController.service(mailController.java:66)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:201)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
    .java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2344)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    462)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso r.java:1011)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja va:1106)
    at java.lang.Thread.run(Thread.java:536)
    thanks in advance
    prabhakar

  • From yesterday, I have been facing the problems in my iphone and my wife iphone. The same problem, "cannot connect to itunes store". I have strong internet connection. I tried all the possible way I could like setting, general, date and time.....etc.

    I have proble of "cannot connect to itunes store. After I have updated the new software ios6, the problem arised in one of my mobile. In the second mobile, I didnot updated the software.Today in the morning, the problem ariesed in that mobile as well. I cannot open the itunes, don't have access to apple store . I tried to solve the problem like going to setting, general, Date and time, automatically off, keeping one year ahead date. I tried all the possible options I could get from the googel. How do I get rid of this problem?

    No - I have not tried other routers on my network.
    What I meant was I could use my itouch on other users wireless networks without any issues.
    I'll update the routers DNS to try  using Google's 8.8.8.8 instead of my ISP.
    Is the issue DNS performance using local ISP -or are there other possibel isues when using local isp DNS?

  • How do I fix the problem cannot connect to iTunes Store?

    How do I fix the problem I encounter on my iPad - cannot connect to iTunes Store?

    Hey Fpatrick13,
    We have an article that goes over troubleshooting for that issue. If you saw an alert message like "Cannot connect to the iTunes Store. An unknown error has occurred" on your iPad, or something similar, check out the bottom of the article titled "Troubleshooting on an iPhone, iPad, or iPod touch" for detailed steps:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Cheers,
    David

  • Hi, I want problem when connect to itunes store , has erroe network?

    Dec 20 2013
    Hi
    when I want connect to itunes store , had error network, follow
    " itunes could not connect the itunes store. The secure network connection was terminated unexpectely"
    Make sure network connection is active and try again.
    Best Reg
    G.T

    Ignore the spam post by engineerT235345.
    Have you tried logging out of your account on your iPad by tapping on your id in Settings > iTunes & App Store and then logged back in and seeing if it then works ?

  • Problem for connection to App Store

    i can't connect to App Store even if i have a valid apple-id;I have a message:"cannot verify your computer"

    Tony...
    Launch iTunes then from the menu bar click iTunes > Preferences then select the Advanced tab.
    Click Reset warnings and Reset cache. From the menu bar click Store > Sign Out.
    Restart your Mac.
    Launch the App Store. See if that helped.

  • Problems with connecting to iTunes Store after loading 10.5.

    Still unable to connect to the iTunes Store after downloading 10.5 to my PC.  I'm running Windows XP with Service Pac 3.  Has anyone had a similiar problem and successfully solved it?  Apple support has been less than helpful!!!

       It worked for me, for iTunes Store and Safari both!
    amandav2 wrote:
    I found a solution to my problem.
    > start menu
    > accessories,
    > right click on the command prompt icon and choose "run as administrator". 
    Once it opens, type in the following command...
    netsh winsock reset
    hit enter
    You should get a message that the winsock reset successful and you will need to reboot your computer. 
    Reboot and when I reloaded itunes the store loaded fine.

  • I am having problems in connecting with App Store. Though I have high internet sspeed ervices

    Is App Store down or something?

    Hello malanni12
    Check out the first article to troubleshoot issues with connecting to the iTunes and App stores. If everything checks out and you think it is down, then check out the second link to see if there is any downtime during that period.
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Apple Services, Stores, and iCloud
    http://www.apple.com/support/systemstatus/
    Regards,
    -Norm G.

  • HT204266 I am facing problem to connect to the App Store using 3G and wi-fi

    Hello
    I am facing problem to connect to App Store from my iphone using 3G and wi-fi. It allows me to update the installed apps.

    The iTune Store is not available in certain countries
    http://support.apple.com/kb/TS3599

  • Connection to Music Store problem

    After installing iTunes 6.0.1 on my iMag G5 I've problems to connect to Music Store (Italy). The most of times I cannot connect and the program do not show errors, other times there is a timeout error connection, when I connect the connection is very very slow. The connection to all other sites are quick as usual with my ADSL line.
    I look in forum to solve the problem but found nothing useful.
    Now I wait for iTunes patch or upgrade, may be I return to use LimeWire.

    You have to follow the directions given in a number of the other posts about getting into MSConfig.
    Go to the start menu, select Run and in the dialog box under Run type MSConfig.
    This takes you to the config panel.
    What I think is happening is that there are certain drivers loading in your system at start-up which are conflicting with the iTunes Music Store software.
    In msconfig, on the general tab, select selective startup.
    Go to Services and check the box that says "hide all microsoft services" this will give you a screen which shows only the third party start-up items. Uncheck all of the items and leave only the iPod Service box checked.
    Then go to the start-up tab and uncheck everything. Then check QTTask and iTunes helper.
    Restart your machine and check to see if you can connect to the Music store. If so you have turned off the conflicting process. You can go back in and add items 1 at time until you find you can't hook up to the music store - then you know what the conflict was. For me it was the D-Link utility.
    All you are doing is trying to isolate the one start-up item thatt is causing the conflict.
    This is a time-consuming process with start-up, reboot, shut down, etc. But it is worthwhile and at the end of it you have isolated the cause of the problem.
    Good luck.

  • No connection with app store with my iPhone4

    Since I've installed iOS6 on my iPhone4, i've always problems to connect to app store... any solution ?

    What is the exact error message that you get? Also, let me know are you using a SIM or a wifi connection?

  • HT1420 Receiving the error 310 while connecting to itunes stores

    I am facing the problem to connecting to Itune store thru my new laptop.
    Pls help it urgent.

    moehadi, Welcome to the discussion area!
    This is typically caused by a firewall or Internet security software running on your PC. Please read the comments in "Error -3256 or -15000 when streaming to AirPort Express base stations using iTunes".
    Also there is "iTunes 8: Unknown error -15000 when attempting to stream music to devices connected to AirPort Express with AirTunes".

  • HT204266 My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

    My iPad (version 1, IOS 5.1) has quit connecting with the store. I am unable to update or buy any app. I did a reboot and a reset with deleting the data. I can not find anything in support for this problem. Any help will be appreciated.

  • HT2292 hello i'm facing  problem  i downloaded iTunes version 11 32bit  and after i installing the set up when i opened the iTunes a massages  occur saying i tunes could not connect to iTunes store an unknown error occurred (-3212) even  though my interne

    Hello i'm facing  problem  i downloaded itunes version 11 32bit for windows 7 and after i installing the set up when i opened the iTunes a massages  occur saying i tunes could not connect to iTunes store an unknown error occurred (-3212) even  though my internet is on

    Try this...
    Triple click anywhere in the line below to select it and press Ctrl+C to copy it.
    cmd /k netsh winsock reset
    Press the WinLogoKey+R to open the run dialog, then Ctrl+V to paste, then press enter/return.
    You should get something similar to this:
    Reboot the computer and the problem should be resolved.
    If it doesn't work then perhaps a full tear down and rebuild of iTunes will fix things. See Troubleshooting issues with iTunes for Windows updates for details.
    tt2

  • Can somebody help me in finding a solution or an explanation to the problem I am currently experiencing as well as others wherein we cannot connect to the iTunes store (iTunes could not connect to the store. An unknown error occurred (0x80096004))?

    Can somebody help me in finding a solution or an explanation to the problem I am currently experiencing as well as others wherein we cannot connect to the iTunes store. An error message appears and either says "iTunes could not connect to the store. An unknown error occurred (0x80096004). Make sure your network connection is active and try again" or "iTunes could not connect to the store.Make sure your network connection is active and try again." Despite the fact that my network connection is working quite fine, this problem still persists. I can say that my connection is fine because I can surf the internet and furthermore, I used to connect to the iTunes store just before this incident happened which started from April 17, 2014 and persists until today. I tried to solve the problem by following the troubleshoot procedures given in the support section of this site but it really did not solve the problem. I believe that others are experiencing this situation as well very similar to mine when it comes to the time of occurrence as I have read in the discussions in this site. Even though we have different network connections, operating systems and other specifications, we still experience the same problem, so is there really a problem with our computers or is it with the iTunes? And by the way, my computer works under Windows XP. Thanks a lot. God bless.

    Try this...
    Triple click anywhere in the line below to select it and press Ctrl+C to copy it.
    cmd /k netsh winsock reset
    Press the WinLogoKey+R to open the run dialog, then Ctrl+V to paste, then press enter/return.
    You should get something similar to this:
    Reboot the computer and the problem should be resolved.
    If it doesn't work then perhaps a full tear down and rebuild of iTunes will fix things. See Troubleshooting issues with iTunes for Windows updates for details.
    tt2

Maybe you are looking for

  • Issue settings.sol in Flash Player 14.0.0.145

    Hello, First of all I apologize for my bad english. I have identified a problem with settings.sol of (in combination with) Flash Player 14.0.0.145. Below I try to explain the problem; Scope: Adobe Flash Player 14.0.0.145 Windows 7 x64 | x86 Internet

  • -9672 - do you know this error?

    Hey I just got a new Airport Extreme Base Station and everything except the printer is working well. I use an HP c3100 all-in-one printer and whenever I try to add the printer I get an error message that just says, "An error occurred while trying to

  • Problem with Work Order Form

    Hi All,            I am workin on Work Order Print for the transaction IW 32. When I choose PRINT/FAX button its generating a spool. and in the transaction IW32 its updating a field system status as 'PRT'. But if I choose 'PRINT PREVIEW', its display

  • Can Nokia E51 new firmware 200.34.36 run Opera Mob...

    Hi, Can someone who have upgraded the firmware for E51 try to run Opera Mobile on it? Thanks Chote

  • Apple Mobile devices and Itunes is taking up 100% of my CPU and I can not get to the Itunes music store on 10.5

    I have installed the 10.5 version of the Apple Itunes app.  Now when I bring it up it takes up one whole CPU and my other CPU is used up by Apple Mobile devices.   I am using Windows XP Service Pack 2.    I have tried uninstalling all Apple products