Wait() statement causing blank JOptionPane -

Hi All ,
I got a unique problem . I m trying to explain the problem in brief .
Description :
In my code i have one Wait() statement and just after that one statement to display JOptionPane.
code snippet (1):
private synchronized void startEucClient() {
if(securityToken == null) {
try{
wait(60000);
     if(securityToken==null) {
JOptionPane.showMessageDialog(w, "No
Response from the server\nEUC timed
Out.", "Error",
JOptionPane.ERROR_MESSAGE);
Now what happens that once this wait() starts , another
method is called where also on some validation i am
displaying one JOptionPane .
/// code snippet (2)
private void methodWhileWait()
if(some_validation)
System.out.println(" Hello I M Here");
JOptionPane.showMessageDialog(w,
"Some problem with Login", "Error",
JOptionPane.ERROR_MESSAGE);
NOW THE PROBLEM IS :
after wait() starts , methodWhileWait() is called and
if{} conditions is satisfied and it also displays
" Hello I M Here"
BUT then JoptionPane gets displayed without displaying the message ( "Some problem with Login")
..so it is BLANK , and message comes on it only when
Wait() is over .
I m not able to understand. HOW TO HANDLE it.
it should display the message then and there
and NOT the blank-JOptionPane (till wait ends)
....WHEN i remove wait() statement then i dont get
blank JOPtionPane but it displays message . BUT i need wait() also.
NEED suggestions on this :
1.IS IT THE PROBLEM of repaint() , how to avoid this ?
2. can it be done with the concept of Thread
, then HOW?
PLEASE HELP.
thanx n regds,
Raj

Try using the invokeLate() method from SwingUtilities class.
For instance:
SwingUtilities.invokeLater(new Runnable(){
    public void run(){
        JOptionPane.showMessageDialog(w, "No Response from the server\nEUC timed Out.", "Error", JOptionPane.ERROR_MESSAGE);
});Also one problem might be if the wait() method runs in the event dispatcher thread. If this is the case then this thread (which manages the GUI) is not able to display any new components until wait() has returned.

Similar Messages

  • I have been having issues with Firefox lately. A thread is in wait state for minutes eating up CPU. More info available.

    When Firefox seems to hang, I usually cannot do anything else but wait until the process has completed whatever it is doing. I am reasonably sure it is a firefox process as it is reported by the wait state analysis.

    It would help to know more about your iMac.
    What year, screen size, CPU speed and amount of RAM installed?
    How full is your Mac's hard drive?
    How many applications do you run simultaneously in the background while working in another application?
    Do you run any antivirus software on your Mac? Antivirus software can slow down the normal operation of OS X.
    Do you run any "crapware" like Mackeeper or any other type of so called hard drive "cleaning" apps?
    Have you downloaded and installed anything recently that might have caused the erratic behaviour of your iMac?

  • File-File: Message are in Waiting state in Integration Engine

    Hi,
    I am trying to execute File-File integration scenario and the message is in Waiting state in Integration Engine.
    I am getting the following error in sxmb_moni:
    <b><SAP:Code area="MAPPING">JCO_SYSTEM_FAILURE</SAP:Code>
      <SAP:P1>Server repository could not create function template for 'SMPP_CALL_JAVA_RUNTIME</SAP:P1></b>
    I am getting the following error in the Visual Admin Trace:
    <b>com.sap.mw.jco.JCO$Exception: (123) JCO_ERROR_FUNCTION_NOT_FOUND: Server repository could not create function template for 'SMPP_CALL_JAVA_RUNTIME3' caused by: com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: User SAPJSF has no RFC authorization for function group SYST .</b>
    Can any one tell me how to provide RFC authorization to SAPJSF user.
    Thanks in advance,
    Nagarjuna

    hi,
    that is the reason for your problem
    The user entered for LOGON in that does not have the requisite privileges.
    Would sugget you contact your basis team and ask them to make the connection going. Then, this problem will be resolved.
    To add more, SLDAPI and the rest are used for the connection between your ABAP and JAVA Stack. As, your mapping gets executed in the JAVA stack, during the execution, as this connection failed, so did your process.
    Get this onnection up and reunning and it willsolve this issue.
    Regards,
    Bhavesh

  • Event is in Waiting state.

    Hi,
    The workflow for PR is not getting triggered because it does not recived any event.
    So when i checked for event queue browser it shows an event for the same PR in waiting state.
    Status of event is:
    Bobject     Event               Workflow     Status
    BUS2009     RELEASESTEPCREATED     WS90000057     Waiting because of e     1
    Could any one please tell me what does this status mean.
    Why the event is waiting, any reason behind it?

    Hey thanks for the quick reply.
    Yes these errors are temporary as now all events are getting posted successfully.
    Now i just wanted to know what will be the reason for getting these Events in Waiting state.
    Also what does it mean "Waiting because of e 1" in status fiels of event.
    I just want to know the root cause.

  • How to make a fucntion  or procedure in wait state?

    HI,
    I would like to know, how to set exclusive locks on the table?
    And I would like to know how to set other processes(function/procedure) in wait state which are accessing the locked table ?
    Any help is appreciated.
    Thank you,
    Regards,
    Gowtham Sen.

    > Here I want to make exclusive lock on a table which is going to be used in different
    processes. So that, I can avoid other processes to insert data into the table
    Why? Why do you want to create a serialised resource in a server - something that only a single process at a time can use?
    Question. What is the biggest cause of performance problem in servers? Any server. Mail server, game server, web server, database server, etc.
    Answer. A resource that cannot be shared and that can only be used by one process at a time. As this causes all other processes to queue and wait for access to that resource.
    What is the biggest cause of performance problem in Oracle? The #1 cause for poor Oracle performance is creating SQLs that cannot be shared. In other words, creating SQLs that do not use bind variables.
    What do you intend to do? You intend to do exactly that. Create a serialised non-sharable resource in a form of a table being exclusively locked.
    Oracle's core design goes to great lengths not to serialise. Writers of data do not block readers of data. Readers of data do not block writers of data. Writers can only block one another when they want to change the same row (i.e. row level locking).
    99.9% of the time, one wants this. One does not want serialisation in any form. Some even complain about row level locking as pessimistic locking seems to them to be a "problem".
    So my question to you, is why? I honestly would like to know what this 0.1% requirement of yours are that will require serialisation to enforced in the database.

  • IBooks sit in "waiting" state after sync

    I have synced my device with my computer and all of my iBooks sit in a "waiting" state and will not sync with my computer.
    I have restored the iPad to factory defaults, reloaded and still the same issue.
    I am signed in with the same account that has the iBooks.
    any ideas why?     

    OK. You said that you synced the books - or at least that's what I took from your post. Did you download these to the iPad?
    Really the more information that you post, the easier it might be to suggest some things but for now you can try these basic boilerplate things that I suggest. It now sounds like you were downloading theses books and something went wrong, but I'm still assuming here,
    Swipe across the progress bar and see if you can bring up the delete button. If you can, delete the book and download it again. You will not be charged again as long as you use the same ID that you bought it with.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>Store>Sign in and then try to download them again or see if the downloads will resume.

  • Why do App downloads for iphone 5s remain in "waiting" state?

    What's causing the following problem?
    I have tried to download the following apps
    Dinner Recipies Eat at Home
    Pepper plate Recipe, Menu & Cooking Planner
    The downloads never complete, Under each grayish incomplete icon is the word "Waiting". I have waited for more than 2 hours and the "Waiting" state continues and i have usable icon app.

    Close all open apps by double-tapping the home button, then swiping up and off the screen with the app window (not the smaller icon).
    Reset your device: hold down the home button along with the sleep/wake button until the screen goes black and you see the Apple, then let go. (No data loss)

  • Clicking on Data tab leaves PQ in a wait state untill disconnect.

    SQL Developer Vser 1.0.0.12.15
    When drilling down into a large table and clicking on a data tab. The database uses parallel query to retrive data then goes into a PX Deq Credit: send blkd wait state. Even after closing the table tab the connection remains in wait state until you completly disconnect or your kill the session.
    The wait state dosen't seem to casue any performance problems except it kicks off false alerts and it ties up PQ servers that could be used for actual queries.
    Is there anyway to automatically limit the number of rows returned the the Data Tab? I would also think after closing the drill down tab that session would be terminated.
    Shawn

    Was there ever any response to this? We have the same issue and it's causing us problems by not cleaning up when the tab is closed.

  • Message in WAIT state after DELAY_TIMESTAMP is in the past

    The queue's view DELAY_TIMESTAMP column appears to have the correct time, but when compared to SYSTIMESTAMP, there's an unexpected five hour difference. After the message should have gone to the READY state, it is still in the WAIT state.
    For example, a message is enqueued using DBMS_AQ.ENQUEUE with delay of 60 seconds. I wait till well after the message should be dequeued. The message is still in the queue despite attempting to dequeue it with DBMS_AQ.DEQUEUE. Here is what the query looks like.
    select delay_timestamp, systimestamp , delay_timestamp - systimestamp
    from AQ$THE_QUEUE;
    DELAY_TIMESTAMP = 7/1/2009 8:23:05.769546 PM
    SYSTIMESTAMP = 7/1/2009 9:06:23.944861 PM +00:00
    DELAY_TIMESTAMP-SYSTIMESTAMP +00 04:16:41.824685
    The difference should be negative because the time should have expired. However, it's positive, 5 hours less the time since it was enqueued.
    This code worked fine until it was re-installed as part of dropping and creating the Oracle user. It works fine on Oracle XE and other Oracle EE databases. The problem is consistent with some change having been done either in Oracle or the Unix operating system. I don't have control over those systems and the administrator says nothing changed. Oracle has been stopped and started since the problem was noticed. The queue table was then dropped and recreated.
    Do you have any idea as to what could cause the difference? It looks like a difference between GMT and CDT time zones. It may be related to the session time zone, but when I set my session time zone to +00:00 to match the server, it becomes a one-hour difference instead of a five-hour difference.
    It is Oracle 10g 10.2.0.4.0.
    Thank you...

    Thanks for the reply.
    Yes, the five hour difference seems too coincidental. An offset in seconds is supplied to ENQUEUE, not a date, but I suppose AQ could calculate a due date based on the session timezone, but why? I'd think session time zone would be for display purposes. The fact that it's behavior changed without changes to the client environments (both JCBC java clients and PL/SQL clients on different machines) with identical PL/SQL code suggests AQ is responding to some kind of server parameter, either Oracle or Unix. I just don't know what.

  • I am having trouble with app updates on my iOS 5 iPhone never getting beyond the "waiting" state.

    I am having trouble with app updates on my iOS 5 iPhone never getting beyond the "waiting" state. I have tried signing out/in of my account, rebooting and removing/re-installing the apps.  This started shortly after going to iOS 5 but I am not certain if that is related.  All updates that I try now are stuck in "waiting".  I also tried removing the apps and then installing via iTunes desktop sync with no improvement.  The only thing that I have not tried so far is a restore to a prior iPhone backup.  I have not been able to find anything to indciate what the updates on waiting on.  There is plenty of space on the iPhone (16gb available).  Any suggestions on what to try next? 

    Hello there, Missy.
    First thing I would recommend is to check your downloads queue to make sure there is not an interrupted download per the following Knowledge Base article:
    iTunes: How to resume interrupted iTunes Store downloads
    http://support.apple.com/kb/HT1725
    If your download was interrupted using your iPhone, iPad, or iPod touch
    1. From the Home screen, tap the iTunes app.
    2. For iPhone or iPod touch, tap More > Downloads. For iPad, tap Downloads.
    3. Enter your account name and password if prompted.
    4. Tap the blue download arrow to resume.
    If you can't complete the download on your iOS device, you can download it in iTunes on your Mac or PC and then sync it to your iOS device. You can also transfer purchases from your iPhone, iPad, or iPod to a computer.
    For Apps, you can also try tapping on the application icon to resume the download, as outline in this featured discussion:
    App updates won't download on my...: Apple Support Communities
    https://discussions.apple.com/thread/4111336
    Try tapping the App, so that it changes to Paused instead of Waiting, then tap it again to resume the install.
    Make sure you don't have any paused downloads in other apps either, like the App Store or iTunes Store.
    If that doesn't do it, try resetting or restoring the iPhone.
    via whatheck
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • IPad 2/iOS 5.1 app updates hung in a 'waiting' state

    After I upgraded my iPad 2 to iOS 5.1, I cannot update my apps. There are hung in a 'waiting' state. Any ideas how to fix this?  This is the first time I've run into this.  I've upgraded to 5.0, 5.0.1 with no problems whatsoever.  Now 5.1 fails to update apps all the time.
    Brian

    For the last few days, since the worldwide launch of the New iPad, Apple's servers have been overwhelmed.  Give it a few days to settle down as a more reasonable number of users access the store. 

  • Adobe Media Encoder Does Not Get out of wait state

    Processor: Intel Core(TM)2 Quad CPU queue 6600 At 2.40 GH Z
    Memory:  8.00 GB
    System Type:     64 – bit Operating System
    Operating System:      Microsoft System 7 Ultra
    When transferring a 1 min. 11 second video from Adobe Premier Pro 5.5 to Adobe Media Encoder 5.5, the file sits in the Media Encoder for hours in the wait state and never completes.
    All my Adobe software is up-to-date. How can I remedy this problem?

    The status "Waiting" indicates that the job is ready to be encoded. As of CS5.5, AME by default does not start processing the Queue automatically. Instead, it waits for you to start encoding by clicking the Start Queue button in the upper right corner of the window--it looks like the Play button on a media player or editing app. Watch folders are an exception to this rule: jobs that come in via watched folders start automatically by default.
    You have the option of having AME start encoding automatically. To enable this, check the "Start queue automatically when idle for <n.n> minutes" and set the desired wait period.

  • CONNECT BY LEVEL IN TRIGGER IS IN WAITING STATE

    WITH emp_data
         AS (SELECT 1 empno,
                    'mgr1' name,
                    NULL mgr,
                    5 num_of_reportees,
                    'Create' Status
               FROM DUAL
             UNION ALL
             SELECT 2,
                    'mgr2',
                    NULL,
                    6,
                    'Wait'
               FROM DUAL)
    SELECT *
      FROM emp_data;
    create sequence emp_data_seq start with 3 increment by 1;
    now I want to insert num of employees based on num_of_reportees column in the table for the emp status = 'Create' and below code is doing the same.
    INSERT INTO emp_data
       SELECT emp_data_seq.NEXTVAL,
              name,
              NULL,
              NULL,
              NULL
         FROM (    SELECT DISTINCT 'emp' || LEVEL name
                     FROM emp_data
               CONNECT BY LEVEL <= num_of_reportees AND status = 'Create');
    Initiall status will be Wait, whenever user changes it from Wait to Create only this operation has to perform, when I place this insert statment in trigger it's not executing and is in waiting state
    Could you please let me know how to achieve this requirement using trigger,
    I couldn't use the procedure for this requirement, Its a standard application and we are doing customization

    SQL> SELECT  *
      2    FROM  emp_data
      3  /
         EMPNO NAME        MGR NUM_OF_REPORTEES STATUS
             1 mgr1                           5 Create
             2 mgr2                           6 Wait
    INSERT
      INTO emp_data
      SELECT  emp_data_seq.NEXTVAL,
              'emp' || column_value,
              NULL,
              NULL,
              NULL
        FROM  emp_data,
              TABLE(
                    CAST(
                         MULTISET(
                                  SELECT  level
                                    FROM  dual
                                  CONNECT BY LEVEL <= num_of_reportees
                         AS sys.OdciNumberList
        WHERE status = 'Create'
    5 rows created.
    SQL> SELECT  *
      2    FROM  emp_data
      3  /
         EMPNO NAME        MGR NUM_OF_REPORTEES STATUS
             1 mgr1                           5 Create
             2 mgr2                           6 Wait
             3 emp1
             4 emp2
             5 emp3
             6 emp4
             7 emp5
    7 rows selected.
    SQL> SY.

  • Wait stats analysis help

    I personally prefer Activity Monitor, Server Standard Reports & Database Standard Reports, however, I keep seeing frightening DMV queries which I don't know how to interpret, in fact, I am not even convinced that the queries are correctly formulated.
    Here is one from a recent Getting Started thread executed on SQL Server 2014. What do I do? What is the meaning of the results?  Thanks.
    WITH Waits AS
    (SELECT wait_type, wait_time_ms / 1000. AS wait_time_s,
    100. * wait_time_ms / SUM(wait_time_ms) OVER() AS pct,
    ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS rn
    FROM sys.dm_os_wait_stats
    WHERE wait_type NOT IN ('CLR_SEMAPHORE','LAZYWRITER_SLEEP','RESOURCE_QUEUE','SLEEP_TASK'
    ,'SLEEP_SYSTEMTASK','SQLTRACE_BUFFER_FLUSH','WAITFOR', 'LOGMGR_QUEUE','CHECKPOINT_QUEUE'
    ,'REQUEST_FOR_DEADLOCK_SEARCH','XE_TIMER_EVENT','BROKER_TO_FLUSH','BROKER_TASK_STOP','CLR_MANUAL_EVENT'
    ,'CLR_AUTO_EVENT','DISPATCHER_QUEUE_SEMAPHORE', 'FT_IFTS_SCHEDULER_IDLE_WAIT'
    ,'XE_DISPATCHER_WAIT', 'XE_DISPATCHER_JOIN', 'SQLTRACE_INCREMENTAL_FLUSH_SLEEP'))
    SELECT W1.wait_type,
    CAST(W1.wait_time_s AS DECIMAL(12, 2)) AS wait_time_s,
    CAST(W1.pct AS DECIMAL(12, 2)) AS pct,
    CAST(SUM(W2.pct) AS DECIMAL(12, 2)) AS running_pct
    FROM Waits AS W1
    INNER JOIN Waits AS W2
    ON W2.rn <= W1.rn
    GROUP BY W1.rn, W1.wait_type, W1.wait_time_s, W1.pct
    HAVING SUM(W2.pct) - W1.pct < 99 OPTION (RECOMPILE);
    wait_type wait_time_s pct running_pct
    DIRTY_PAGE_POLL 151934.29 25.22 25.22
    HADR_FILESTREAM_IOMGR_IOCOMPLETION 151852.24 25.21 50.43
    SP_SERVER_DIAGNOSTICS_SLEEP 151766.79 25.20 75.63
    BROKER_EVENTHANDLER 142613.28 23.68 99.30
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

    Hello Kalman,
    Above query used DMV sys.dm_os_wait_stats to filter out source on which thaead were waiting.There is kind of internal counter which is updated every time when query waits for any specific resource. LIke if you have slow disk subsystem wait type Async_io_completion
    shows huge wait time.It happens like counter start when thread wiats and time is recorded and when it finaly gets resourse counter is stopped. So duration is stored in buffer cache. If you restart SQL server all values are cleared.
    DIRTY_PAGE_POLL
    is wait type introduced in 2012 and is related to inderect checkpoint.I still consider it as benign wait type
    HADR_FILESTREAM_IOMGR_IOCOMPLETION is also new wait type introduced in 2012 and it gets populated when you are using Always ON .Not still worked heavily on always on so cannot comment.
    Other two are benign wait types.There would always be some value for wait types no matter whether your system is experiencing issue or not.Wait stats help us correlate waiting time on particular wait type with issue we are facing. iF YOU HAVE QUERY SLOWNESS
    AND YOU SEE LOT OF PAGEIO* wait types one can say that query is missing indexes or goging thorugh table scan ore possible index is fragmented.Its a long list and I would like you to start from below link by Paul.
    https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • WAIT statement  used, IDOC output time still same

    HI All,
    I have created a Zprog to trigger zIDOCs from R/3 to XI.
    In my program, multiple idocs of same type are created as the processing is within a loop statement.
    Due to this fact 5-6 idocs are created within a second and sent out immediately to XI.
    However I want idocs to go to XI in 1 sec intervals, so I introduced the WAIT statem,ent in the loop.
    But when I check WE02, again all IDOCS are craeted in the same time(second), so I do not see any time delay.
    I wanted to know if theer is a way to introduce REAL DELAY in sending IDOCs from R/3 to XI as currently all my idocs are going out at same time inspite of using WAIT statement.
    In my partner profile I have tried the scenatio with Process immediately and also with collect Idocs(packet size 1), but its not helping.
    Any suggestions, how to make the idocs leave R/3 witha time delay of 1 sec each between them?
    Appreciate any suggestions/pointers.
    Many thanks
    Shirin

    Hi Swastik,
    Will  WAIT UP TO 60 SECONDS help and send idocs in 1 sec interval.
    I do not want a very long delay between these idocs.
    Or is it that wait upto 60 ecs translates to 1 sec internally....just trying to understand.
    Appreciate if you could clarify.
    Many thanks
    Shirin

Maybe you are looking for