Threads not dieing

would there be any reason for a thread not dieing after the run
method completes ?
my run metho completes, but the reads still appear in the '.activeCount()' result
from Thread.currentThread() ... ???

wow, so majinda was right; hmm.Amazingly, yes.
i suppose to be completely sure i need to track them
myself then ?Yes, I guess so. I looked at the API for 1.5 and noticed the following additional comments:
"The result might not reflect concurrent activity, and might be affected by the presence of certain system threads.
Due to the inherently imprecise nature of the result, it is recommended that this method only be used for informational purposes."
What these "informational purposes" are, I have no idea ...
any hints on what it uses to do this 'estimate' ... ?Not without looking at the code in more detail. Whatever it uses seems to generate race conditions though.

Similar Messages

  • Not sure if thread is dying

    I have a small chat application passing sockets to seperate threads. The application is set to be a daemon thread so I can close the application that launches it.
    I added small checks throughout the application to see the number of active threads.
    There are two things happenning that I don't understand:
    1. When I first start the application there are always 61 (including newly created daemon) threads running. I assume these are necessary background threads running in the servlet container (Tomcat 5) and the JVM.
    2. When I log in with one client (creating a new socket and therefore new thread on the server's end) the thread count goes to 62. As I log in with other clients the thread count increases accordingly. The strange thing is that when I exit the client application therefore ending the run() method of that thread the first client to exit always seems to have its thread stay alive. By that I mean if I add 3 clients taking the thread count from 61 to 64, then close one client the thread count stays at 64. But then if I close another client then the thread count goes down to 63. The other strange thing is that if I close all clients the thread count remains at 62 (instead of 61 where it should be) and if I then log in another client the thread count remains at 62 but increases with every new client after that. It seems that the first client thread stays active and somehow new sockets can just replace that thread. Since none of the code is different if it's the first socket or the 20th....how can this first one not die and then even get replaced.
    Sorry for the long description....I really am not that well versed in threads. If anyone could shine some light on this problem (or even offer a suggestion as how to better monitor whether the threads are dying or not) I would really appreciate it. Thanks in advance.

    You should experiment/test a little more. Dig around until you can find out what's going on. It's not hard.
    For example, try naming all of your threads. This will allow you to see which threads are yours and which belong to the system. Then, print out the names of only the threads you created, from time to time. You might do this by matching on the name, or perhaps by assigning all of your threads to a single thread group. You also might want to print a message when your thread terminates (that is, at the very bottom of its run() method), for each thread.
    By the way, jconsole is a very useful JVM monitoring tool. It allows you to connect to your application and see which threads are running and what they are doing (among other things). It comes with the Sun JDK.
    Jim

  • Waiting for a thread to die.

    Hello, I hope you can help me...
    I am writting a jdk1.4.1 Swing application that displays a small animation. This animation is processed from within a separate thread. My program makes a call starting this 'animation thread'. For practical reasons my program needs to wait for this thread to die (and thus the full animation to be shown) before it can continue. I am waiting for the animation thread to die using Threads 'join' method. However the problem with this is that I am forcing the GUI thread to wait resulting in the animation being calculated but not displayed. And so... how can I fix this... all I want is to wait until the animation is shown.
    What I would like to do is:
    1. Start animation;
    2. wait intil animation has completed;
    3. continue with program.
    Any help or advice will be greatly appreciated.
    Thank you in advance.

    Maybe this design could work for you. You divide your program into three parts running in three separate threads.
    1. The main thread handling GUI stuff and coordination of the two other threads.
    2. A working thread doing most of what the main thread is now doing.
    3. The animation thread.
    With this division of labour the working thread is waiting for the animation thread to finish (the main GUI thread isn't). The main thread will be free at all times to react to the users input or updating the screen or whatever, while the other two threads are cooperating to produce the animation.

  • BSP session not dying when browser window closes

    Hi,
    I am having a small problem with the bsp session. I shall explain the prb with an example.
    Lets say i have a bsp application BSP1. I open the application from the Favorites tab in the SAPGUi.
    Initially, i have another browser window open containing google.com(this is imp that i have another browser open all the time containing anything). I now start BSP1, then i close the window by hitting the close button of the browser, as a result the controller sends a exit view back to the frontend which never gets displayed. now i start BSP1 again from SAPGUi, and the browser instead of showing me the logon screen and the start page goes to the exit page of the application. In other words to the last URL that i visited last time in the application. Somehow when the window is closed, the session on the applicaiton server is not dying. This only happens if i have any other browser open all the time containing any thing.
    If i do not have any other browser open, and then i follow the above sequence of events,everything runs smoothly. Also, in the previous case, if i close the google window also and start the application again, everything runs smoothly. In IE settings , in Advanced tab there is a setting for REUSE EXISTING WINDOWS FOR LAUNCHING SHORTCUTS. If i set this option, everything runs smoothly, even if i have a Google(whatever) window open all the time. If i do not set this option, i run into the problem as in the first case. Also, if instead of opening the application through the SAPGui i open another browser from the taskbar and type in the URL , everything runs smoothly inspite of another google window being opened all the time.
    Also this problem is evident in systems with BASIS 640/level 10 and BASIS 620/level 19. It might be present in other versions also but i am working on these two systems with these versions. This problem does not pop up on BASIS 700.
    If on exit, within the controller, i reset the keep_context attribute of RUNTIME  object, everything runs smoothly.
    could you please guide me as to what can be the problem here and how it can be solved. It is important. Any kind of help and guidance would be highly appreciated.
    Looking forward to your response,
    Thanks and best regards,
    Ghufran

    The very first important aspect to understand is that CANCEL kills the session long before the request reaches the ABAP stack. So what ever you want to do, this is not the way to go.
    From reading your first post in this thread through, I have the impression that you might have some confusion between stateful versus authentication. No, I it is not the problem/solution, but just that your very long descriptions without using consistant terminology makes it difficult to understand where we are going.
    Thus, I would recommending read this article for background information:<a href="/people/mark.finnern/blog/2003/09/24/bsp-in-depth-confusion-between-stateless-stateful-and-authentication">BSP In-Depth: Confusion between Stateless, Stateful and Authentication</a>.
    Next, you CAN NOT "redirect it to the browser on the onbeforeunload() event". Well, at least I never have never succeeded.
    Once the closed button is hit, you have not many options. One idea is a window.open, see system application for examples. The other is the image loading trick that Thomas describes in his weblog. Both ideas will actually solve your problems (once you really understand what is happening). This is unfortunately not always perfectly easy.
    brian

  • ARC0: Becoming the 'no FAL' ARCHARC0: Thread not mounted

    Hi All,
    My DB is in NOARCHIVELOG mode. When I try to switch it (using SAPDBA) to ARCHLOG mode, the DB goes into an 'unkown status' and I have to shutdown and startup the DB to get it back in operation. The DB is still in NOARCHIVELOG mode. This is a problem in terms of media recovery.
    ARCH: STARTING ARCH PROCESSES                            
    ARC0 started with pid=8                                  
    ARC0: Archival started                                   
    ARC1 started with pid=9                                  
    Thu Apr 12 22:22:00 2007                                 
    ARCH: STARTING ARCH PROCESSES COMPLETE                   
    Thu Apr 12 22:22:00 2007                                 
    ARC0: Becoming the 'no FAL' ARCH                         
    Thu Apr 12 22:22:00 2007                                 
    ARC1: Archival started                                   
    Thu Apr 12 22:22:00 2007                                 
    ARC0: Becoming the 'no FAL' ARCHARC0: Thread not mounted 
    Thu Apr 12 22:22:00 2007                                 
    ARC1: Becoming the heartbeat ARCH                        
    ARC1: Becoming the heartbeat ARCHARC1: Thread not mounted
    What could be the problem? I have search OSS, the alert log and arc log files but to no avail.

    Hi,
          Use ARCHIVE_ON.BAT and ARVICHE_OFF.BAT ..U can find these 2 batch files under \usr\sap\sid\sys\exe\run
    Regards
    Umesh K

  • Java.lang.IllegalMonitorStateException: current thread not owner

    Hello,
    my program runs an exe that doesn't return a zero when it's finished, therefore, I can't use a waitFor().
    To solve this problem i look at the length of the file which has to be manipulated by this exe every 200ms and see whether it's length stopped changing. This should mean it's job is done...
    But using this code:
    public void run(String filename)
              System.out.println("start runtime");
              Runtime rt = Runtime.getRuntime();
              String[] callAndArgs = { "lssvmFILE.exe", filename };
              try
                   Process child = rt.exec(callAndArgs);
                   child.wait(200);
                   filesize = 0;
                   while(filesize != file.length())                            {
                        filesize = file.length();
                        child.wait(200);
                   //child.waitFor();
                   System.out.println("Process exit code is:   " + child.exitValue());
              catch(IOException e)
              {     System.err.println( "IOException starting process!");}
              catch(InterruptedException e)
              {     System.err.println( "Interrupted waiting for process!");}
              System.out.println("end run");
         }i get this on my System.out:
    Exception occurred during event dispatching:
    java.lang.IllegalMonitorStateException: current thread not owner
            at java.lang.Object.wait(Native Method)
            at LssvmFile.run(LssvmFile.java:292)
            at LssvmFile.start(LssvmFile.java:189)
            at GUI.actionPerformed(GUI.java:137)
            at java.awt.Button.processActionEvent(Button.java:329)
            at java.awt.Button.processEvent(Button.java:302)
            at java.awt.Component.dispatchEventImpl(Component.java:2593)
            at java.awt.Component.dispatchEvent(Component.java:2497)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

    Here's the code:
    I already found out that the sleep function indeed caused this exe to run so slow. It seems that everything stops when sleep is used. By setting the delay to 2ms the duration is satisfactory (some seconds).
    I also tried skipping the sleep and just using a while, but that ended in an endless loop. Setting the delay to 1ms lead to a stop when the filelength was 0 (i guess that was on the moment that the exe cleared the file and prepared to write) so it seems to me that 2ms is quite a good trade off.
    this part of the code is preceeded by writing the data to the file and afterwards the new data will be read in again...
         //Close the stream
              outFileStream.close();
         //Run lssvmFILE.exe to compute alpha & b
              long originalfilesize = file.length();
              run(filename);
              //wait untill job done
              Thread thread = new Thread();
              long filesize = file.length();
              try{thread.sleep(2);}
              catch(InterruptedException e){};
              while(filesize != file.length() || originalfilesize ==file.length())
                   filesize = file.length();
                   try{thread.sleep(2);}
                   catch(InterruptedException e){};
         //Set up Instream (read from file)
         //----------------------Bedankt!
    Bart

  • Javaws 1.4.2 "current thread not owner"

    Hello everyone,
    I have an application that I have been launching with javaws since the javaws 1.0.x days that won't work with javaws 1.4.2. Does anyone have any clue as to what could be wrong?
    Java Web Start 1.4.2 Console, started Thu Aug 21 09:15:25 EDT 2003
    Java 2 Runtime Environment: Version 1.2.2 by Sun Microsystems Inc.
    --------- EXCEPTION ---------
    java.lang.IllegalMonitorStateException: current thread not owner
         at com.sun.javaws.security.JNLPClassPath.findNamedResourceInLoaders(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.sun.javaws.security.JNLPClassPath.findNamedResource(Unknown Source)
         at com.sun.javaws.security.JNLPClassPath.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java)
         at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java)
         at org.apache.xerces.parsers.DOMParser.<init>(DOMParser.java)
         at com.fpl.ima.deployit.options.DeployItOptions.loadOptions(DeployItOptions.java, Compiled Code)
         at com.fpl.ima.deployit.options.DeployItOptions.getInstance(DeployItOptions.java)
         at com.fpl.ima.deployit.DeployIt.initialize(DeployIt.java)
         at com.fpl.ima.deployit.DeployIt.<init>(DeployIt.java)
         at com.fpl.ima.deployit.DeployIt.main(DeployIt.java)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)
    Exception occurred in main() of DeployIt
    java.lang.IllegalMonitorStateException: current thread not owner
         at com.sun.javaws.security.JNLPClassPath.findNamedResourceInLoaders(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.sun.javaws.security.JNLPClassPath.findNamedResource(Unknown Source)
         at com.sun.javaws.security.JNLPClassPath.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.fpl.ima.deployit.DeployIt.main(DeployIt.java)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)

    I can only guess at the likely cause. Previously (jws 1.2 and earlier) every web start process would kick off a jvm for the web start client to process the jnlp, this would in turn then kick off a second jvm to run the actual application.
    1.4.2 has changed this slightly to improve startup time etc.. the second jvm process doesn't happen, and now the web start app runs from the same jvm that the web start client has started for itself. This is why the integration dialog is such a problem with modal apps in 1.4.2 -- they're sharing (and conflicting with) the same event thread.
    At least this is what I think is happening ~ I'm very sure but cant be 100% certain ..because much like the autodownloads Sun haven't published any of the source for 1.4.2 web start (shouldn't this be part of the shipped sdk source these days?).
    I guess this change breaks your previous class-loading assumptions.
    - Richard

  • Error starting thread: Not enough storage is available to process...

    Hi all,
    We are seeing server going down frequently with below exception:
    [ERROR][thread ] Failed to start new thread
    [2010-04-08 14:36:54,046][ERROR][com.astrazeneca.portal.rss.ContentTransformer] - Error processing item:null
    ; SystemID: http://beaa.astrazeneca.net:10002/NewsBroker/resources/newsToRss.xsl; Line#: 21; Column#: 128
    javax.xml.transform.TransformerException: java.lang.Error: Error starting thread: Not enough storage is available to process this command.
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:403)
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:426)
         at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)
         at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:437)
         at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:199)
         at org.apache.xpath.XPath.execute(XPath.java:268)
         at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:279)
         at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:247)
    I have a weblogic support SR open and they suggested to add -XXtlaSize and -XXlargeObjectLimit to our JVM parameter. With these parameters, we are getting below error in Windows frequently:
    Reporting queued error: faulting application java.exe, version 1.5.0.11, faulting module jvm.dll, version 27.3.1.1, fault address 0x0014b442.
    I have seen few threads on Sun forum, but answer was not posted there. Details of our environment are as below:-
    JVM : JROCKIT 1.5.0.11
    OS : Windows 2003
    Application Server : Weblogic 10
    Any inputs or pointers will be highly appreciated as this is a bit urgent for me...
    Thanks & Regards,
    Sanjeev

    Hi Henrik,
    I am running Weblogic with below parameters now:
    -Xnohup -Xms:1536m -Xmx:1536m -XXtlaSize:min=32k,preferred=768k -XXlargeObjectLimit:32K
    Weblogic crashed again with below dump:
    ===== BEGIN DUMP =============================================================
    JRockit dump produced after 0 days, 07:17:18 on Fri May 07 15:26:16 2010
    Additional information is available in:
    E:\PortalLIVDomaina\jrockit.5772.dump
    E:\PortalLIVDomaina\jrockit.5772.mdmp
    If you see this dump, please open a support case with BEA and
    supply as much information as you can on your system setup and
    the program you were running. You can also search for solutions
    to your problem at http://forums.bea.com in
    the forum jrockit.developer.interest.general.
    Error Message: Illegal memory access. [54]
    Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x005148AF - memory at 0x00000000 could not be written.
    Minidump : Wrote mdmp. Size is 1406MB
    SafeDllMode : -1
    Version : BEA JRockit(R) R27.3.1-1_CR344434-89345-1.5.0_11-20070925-1628-windows-ia32
    GC Strategy : Mode: throughput. Currently using strategy: genparpar
    GC Status : OC currently running, in phase: sweeping. This is OC#3000.
    : YC is not running. Last finished YC was YC#9937.
    OC History : Strategy genparpar was used for OC#1.
    : Strategy singleparpar was used for OC#2.
    : Strategy genparpar was used for OC#3 to OC#3000.
    YC History : Ran 11 YCs before OC#2996.
    : Ran 18 YCs before OC#2997.
    : Ran 11 YCs before OC#2998.
    : Ran 8 YCs before OC#2999.
    : Ran 1 YCs before OC#3000.
    Heap : 0x00900000 - 0x60900000
    Compaction : 0x06900000 - 0x0C900000
    Could you please provide some input on this?
    Thanks,
    Sanjeev

  • Player's position slider (Thread not owner)

    Hi every1,
    I've a thread that sets a slider value with the player's time in secods,but in case the slider Knob is dragged by the user the thread should wait and player's time should be set as per the value dragged by the user.
    But the wait() method is not executing instead it generates IllegalMonitorStateException: current thread not owner exception. Would you help me please?
    My code is:
    //the thread which sets the slider value as the time in second increases
    public void run() {
         while (true) {
                        if (player != null) {
               nano = player.getMediaTime().getSeconds();
              if (dura >nano) {
                  timex = (int)nano;
                        jSlider.setValue(timex);
                     try {
              Thread.currentThread().sleep(1000);
             } catch (InterruptedException ie) {
        }//the method which sets the slider as a user moves the knob of the slider
    jSlider.addChangeListener(new javax.swing.event.ChangeListener() {
                public void stateChanged(javax.swing.event.ChangeEvent evt) {
                   try{
                      if(jSlider.getValueIsAdjusting()){
    player.setMediaTime(new javax.media.Time((double)  
    jSlider.getValue())); 
                    thr.wait();                  }
                   }catch(Exception e){e.printStackTrace();
                      System.out.println("Exception @ jSlider stateChanged : " + e.getMessage() );
            });Thanks!

    The exception is happening because the ChangeListener thread does not own the monitor on "thr" (see the api documentation for Object.wait). That can be fixed by putting it in a synchronized (this) { ... } block.
    However, I see bigger problems. First, recognize that Java is going to call your ChangeEvent code on the event handling thread, so you definitely don't want it to wait. The screen will stop repainting and the user's mouse release event won't be processed, because you will have suspended the thread that handles those things. Second, you should not modify the position of the slider from any thread other than the event handling thread, for reasons documented at [http://java.sun.com/developer/technicalArticles/Threads/swing/]. That article also shows techniques that are safe.
    I don't mean to be discouraging, just wanted to point out a couple more things so you didn't get strange behavior without knowing why! What you are attempting actually requires some multi-threading skill, so study up!
    Cheers,
    Eric

  • FileUpload: Current thread not ownet?

    Hi, I use the common Apache FileUpload lib.
    When i use it on my local server i work!
    But on my NetWare Tomcat server, i got this message:
    Error Message:current thread not owner
    java.lang.IllegalMonitorStateException: current thread
    not owner
    at
    org.apache.commons.fileupload.DefaultFileItem.getUniqueId(DefaultFileItem.java,
    Compiled Code)
    at
    org.apache.commons.fileupload.DefaultFileItem.getTempFile(DefaultFileItem.java:623)
    at
    org.apache.commons.fileupload.DefaultFileItem.getOutputStream(DefaultFileItem.java:563)
    at
    org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java,
    Compiled Code)
    at UploadFile.doPost(UploadFile.java:54)
    Someone got an id�a???
    thx a lot

    Are you using java 1.4 ? And so is your netware server ?
    http://developer.java.sun.com/developer/bugParade/bugs/4776385.html

  • Did not die after sending SIGKILL

    In the past 2 days, I've experienced significant slowdown.
    The only thing new is that I'm attempting to switch from Eudora to Mail.
    Here's what is repeating -- ENDLESSLY -- per Console:
    ...com.apple.launchd[1] (com.apple.RemoteDesktop.agent[74]): Did not die after sending SIGKILL 865 seconds ago...
    I have searched and there is no RemoteDesktop or ARD accessible on my machine!
    HELP

    Just FYI, all copies of Mac OS X since, I believe, 10.4 have the Remote Desktop client included.
    Check the Sharing preferences and see if either Remote Management or Screen Sharing are checkmarked. If either are, uncheck them and see if that stops the messages.
    I presume you've restarted your computer, yes?
    Regards.

  • [SOLVED] xss-lock does not die on logout

    Hello,
    I am trying to find a workaround for the problem I mentioned here
    So far I have installed i3lock from the standard repository and xss-lock from the AUR. I disabled screen locking and screen blanking in Gnome. I added the following desktop files to both users ~/.config/autostart
    [Desktop Entry]
    Type=Application
    Exec=xss-lock -- 'xautolock -locknow'
    Hidden=false
    NoDisplay=false
    X-GNOME-Autostart-enabled=true
    Name[en_US]=SuspendLock
    Name=SuspendLock
    Comment[en_US]=AutoLock the screen before suspend
    Comment=AutoLock the screen before suspend
    [Desktop Entry]
    Type=Application
    Exec=xautolock -time 3 -locker 'i3lock -d -c 000000'
    Hidden=false
    NoDisplay=false
    X-GNOME-Autostart-enabled=true
    Name[en_US]=XautoLock
    Name=XautoLock
    Comment[en_US]=AutoLock the screen
    Comment=AutoLock the screen
    I also added a custom keyboard shortcut:
    xautolock -locknow
    with the accelerator set to Super+L
    So far, it seems like this will work fine. It seems to be working better than GDM locking. I have seen one problem thus far... If I log out of Gnome, xss-lock continues to run. If I log in again, I get a new xss-lock process. The original process continues to run and has one core at 100% load. If I log out again and log in again, I get yet another xss-lock process. This also runs at 100% load. This same phenomenon happens if I start the xss-lock from a terminal. xss-lock does not die on logout...
    Why does xss-lock not die on logout?
    Should I be using a systemd service file instead of xss-lock? I did try the service file, but it seems to work inconsistently because the DISPLAY variable continues to change.
    Any suggestions?
    Last edited by bnb2235 (2014-09-28 12:17:32)

    Hi bnb2235,
    I've seen the same behavior from xss-lock.  This is what I've done to set things up with i3 on my laptop:
    1) I don't use systemd and/or an autostart file for xss-lock
    2) I start xss-lock with the following line near the end of my i3 config file:
    exec --no-startup-id xss-lock -- i3lock -b -i /home/username/.config/i3/metal_grid_w_arch.png &
    3) My i3 nagbar looks like so in the i3 config file:
    # exit i3 (logs you out of your X session)
    bindsym $mod+Shift+e exec --no-startup-id "/usr/bin/paplay /usr/share/sounds/Feather/beep.wav && i3-nagbar -f pango:Arimo -t warning -m 'WHAT DO YOU WANT TO DO?:' -b 'Shutdown?' 'systemctl poweroff' -b 'Reboot?' 'systemctl reboot' -b 'Exit i3?' 'killall xss-lock && killall nm-applet && i3-msg exit'"
    So I explicitly kill xss-lock and nm-applet priot to i3 being exited. This has kept xss-lock from exhibiting the behavior you describe (as well as prevents coredumps from nm-applet when i3 exits).
    Last edited by halocaridina (2014-09-25 01:43:52)

  • Threads not working together well  !

    Dear People,
    The following line of code gives an error message:
    while(inTray.size() != 0)
    The error message says:
    current thread not owner, Exception in thread "main"
    Thank you for your advice
    Stan

    Dear Dubwai,
    Here is the entire output. (Except for entire list
    t of credits and debits posted by the bank. )
    Start debit of A//C No. 2 : $971 amount: 45
    Start credit of A//C No. 1 : $624 amount: 71
    End credit of A//C No. 1 : $695 amount: 71
    java.lang.IllegalMonitorStateException: current thread
    not owner
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:426)
         at stan_ch15p638.Clerk.isBusy(Clerk.java:80)
    at
    stan_ch15p638.TryBankOperation.main(TryBankOperation.j
    va:75)
    End debit of A//C No. 2 : $926 amount: 45
    Start debit of A//C No. 2 : $926 amount: 48
    Exception in thread "main"
    I would post the entire program but the last time I
    did that
    I received a negative response. The error message
    speaks of
    line 75 which is the line posted previously.No it isn't.
    This is what you posted.
    while(inTray.size() != 0)
    In the above stack trace the following appears...
    Clerk.isBusy...
    That is where the problem occurs in your code.

  • IllegalMonitorStateException: current thread not owner

    Hello I'm a new french developper in JAVA.
    I have problems to launch a command from my main class.
    Here is the method :
    private static boolean ConvertToPDF(Vector HTMLPath, String PDFPath, boolean DeleteHTMLSourceFile) {
              boolean      ConvertOK           = false;
              String           HTMLDocCommand      = "";
              String           HTMLSourcePath     = "";
              String           command;                // Command string
              Process      process;                // Process for HTMLDOC
              Runtime      runtime;                // Local runtime object
              InputStream input;
              byte           buffer[];
              int           bytes;
              // R�cup�ration du chemin du r�pertoire tampon HTML dans le fichier general.properties
             try {
                  mailProperties = (PropertyResourceBundle) ResourceBundle.getBundle("General");
             catch (MissingResourceException e) {
                  System.out.println("ConvertToPDF - Impossible de localiser le fichier general.properties");
             HTMLDocCommand = mailProperties.getString("HTMLDocCommand");
             for (int i=0;i<HTMLPath.size();i++){
                  HTMLSourcePath += (String) HTMLPath.elementAt(i) + " ";
              command = HTMLDocCommand+" "+PDFPath+" "+HTMLSourcePath;
              // Lancement du processus et attente de fin ...
              runtime = Runtime.getRuntime();
              try
                   process = runtime.exec(command);
                   System.out.println("D�but attente du processus");
                   process.notifyAll();
                   bytes = process.waitFor();
                   process.notifyAll();
                   System.out.println("Fin attente du processus");
                   // V�rification de l'existence du fichier de sortie
                   File PDFFile = new File(PDFPath);
                   if (PDFFile.exists())
                        ConvertOK = true;
                   else
                        ConvertOK = false;
              catch (Exception e)
                   ConvertOK = false;
                   System.out.print(e.toString() + " caught while running:\n\n");
                   System.out.print(" " + command + "\n");
              return ConvertOK;
         }When I Executing my class (from a windows command prompt) i Have this error message :
    IllegalMonitorStateException: current thread not owner caught while running <mycommand>
    I have also tried to use the "synchronied method" :
    private static boolean ConvertToPDF(Vector HTMLPath, String PDFPath, boolean DeleteHTMLSourceFile) {
              boolean      ConvertOK           = false;
              String           HTMLDocCommand      = "";
              String           HTMLSourcePath     = "";
              String           command;                // Command string
              Process      process;                // Process for HTMLDOC
              Runtime      runtime;                // Local runtime object
              InputStream input;
              byte           buffer[];
              int           bytes;
              // R�cup�ration du chemin du r�pertoire tampon HTML dans le fichier general.properties
             try {
                  mailProperties = (PropertyResourceBundle) ResourceBundle.getBundle("General");
             catch (MissingResourceException e) {
                  System.out.println("ConvertToPDF - Impossible de localiser le fichier general.properties");
             HTMLDocCommand = mailProperties.getString("HTMLDocCommand");
             for (int i=0;i<HTMLPath.size();i++){
                  HTMLSourcePath += (String) HTMLPath.elementAt(i) + " ";
              command = HTMLDocCommand+" "+PDFPath+" "+HTMLSourcePath;
              // Lancement du processus et attente de fin ...
              runtime = Runtime.getRuntime();
              try
                   process = runtime.exec(command);
    synchronized(process){
                   System.out.println("D�but attente du processus");
                   process.notifyAll();
                   bytes = process.waitFor();
                   process.notifyAll();
                   System.out.println("Fin attente du processus");
                   // V�rification de l'existence du fichier de sortie
                   File PDFFile = new File(PDFPath);
                   if (PDFFile.exists())
                        ConvertOK = true;
                   else
                        ConvertOK = false;
              catch (Exception e)
                   ConvertOK = false;
                   System.out.print(e.toString() + " caught while running:\n\n");
                   System.out.print(" " + command + "\n");
              return ConvertOK;
         }But I have the same error message. Maybe the synchronised is not on the right object ?
    Could anyone help me ?
    Thanks for all.

    - The exception is thrown during process.notifyAll() calls; can u try commenting out those calls?
    - For questions on java, you may also want to try the forum at:
    http://forum.java.sun.com/category.jspa?categoryID=32

  • Current thread not owner

    Exception in thread "AWT-EventQueue-0" java.lang.IllegalMonitorStateException: current thread not owner
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Unknown Source)
         at OneTab.OneForm.OneForm.stop_watch(OneForm.java:104)
         at DraMain_Sub.actionPerformed(DraMain.java:129)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)I just want to know this message.
    "java.lang.IllegalMonitorStateException: current thread not owner".
    What is it?
    try{
    this.wait();
    }catch(InterruptedException e){}I just want to do it.

    my initial guess would be that the OP needs a refresher on wait and
    notify. There are plenty of tutorials available and spending 15 20
    min on one of them would not be a waste of time, trust me!!!!!But this reply did not come from Jos, so it will apparantly be ignored.Hm, if that were true I wouldn't like it one bit. Lots of people give valuable
    advice here and the last thing I would want is a 'status aparte'.
    kind regards,
    Jos

Maybe you are looking for