Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.

Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced while changing OS time.
I found a BUG in java bug list. The bug id is 6311057 with fixed status. But I find it still existing.
Under CentOS6 x64 platform, on JDK1.6.0_33, the bug still exists.
But under CentOS5 x64 platform, on same JDK, the problem does not exist.
Could anyone give me help? Thanks.
The bug's link is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311057
Edited by: user10222290 on 2012-6-13 下午9:22

user10222290 wrote:
One server could want to synchronize it's OS time with another server when they connected each other for some business reasons. I have 3 computers running pretty much continuously with time synchronised from one of the internet time servers. They never seem to be more than about 1/10 th second apart and any time corrections are very very small.
Some threads have started to run before changing OS time, so these thread's sleep process will be influenced sometime seriously.I understand that but I would only expect this to be a problem when there is a significant change to the OS time. If each server is synchronized to a time server then the time corrections will be very very small.
If OS time was turned back some days, these thread could not wake up untill some days passed.Agreed but why would the "OS time be turned back some days" ?
This whole problem seems to me to arise because the servers are not time synchronized. Now I understand that there may be concerns about the security of external time servers but it is easy enough to make one of the local servers a master and act as a time server to the others.
I have a small server that typically services some 30 or so external clients. I don't have any control over the clients and do not know anything about the setting of their system clocks. The clients send a time signal as part of a heartbeat and from this the server keeps track of the local time on each client and compensates for any difference when writing logs. I have seen this difference as big as 4 months but the compensation corrects it to within about a second. No adjustment of clocks is required for this.
I still don't see this 'bug' as a serious bug. I just see a design problem to be solved without changing the OS time on any computer. I know this can be done since I do it. The only problem I see is if you want an accuracy of better than about 20 mS but that does not seem to be required for your system.
Note - if Oracle accept your new bug report it could take years to fix even if lots of people vote for it to be fixed.

Similar Messages

  • Java Thread.sleep(timeout) is influenced by changes to System time on Linux

    Java Thread.sleep(timeout) is influenced by changes to System time on Linux
    bugId : 6311057
    I encountered this problem in redhat6/ jdk 1.6

    890651 wrote:
    Java Thread.sleep(timeout) is influenced by changes to System time on Linux
    bugId : 6311057
    I encountered this problem in redhat6/ jdk 1.6At least half the time I use it, I'd want it to be, the other half I wouldn't care.
    What are you doing with it where this might be a problem?
    Changing the system clock abruptly can cause all kinds of problems with your system anyway, because various background activities etc. often depend on file dates. Wherever possible use the "skew" method to adjust your system clock, rather than just plonking in a new value, especially if you are setting the clock backwards.

  • Java Thread.sleep() on Windows 8 stops in S3 sleep status

    There's a desktop application that uses Thread.sleep() to achieve long (minutes or hours) delays. This same application has been working fine from Windows XP through Windows 7. The application calculates how far in the future it needs to do something, then hits a Thread.sleep(msToWait). This has been working fine, even if the system happens to go into S3 or S4 sleep state during the wait.  All is good as long as the machine is awake at the time when the sleep expires.
    As of Windows  8 (and 10), though, the code after Thread.sleep() does not execute "on time" if the machine has been in S3 during the sleep interval. It appears that the machine begins executing code at "msToWait" plus the time the machine has been in S3.
    Earlier versions of Windows did not exhibit this behavior; code after Thread.sleep() waited the right amount of time, irrespective of sleep status.
    A test program and procedure were developed. The procedure is to 1) run the program, 2) cause the machine to sleep for about a minute, then 3) wake the machine and wait for the program to finish.
    If this the program is run on Windows 10 (reporting as 8) with JVM Version: 25.40-b25, it fails (the 63589 corresponds to the minute that the machine was in S3):
    C:\Users\Tester\Downloads>SleepTester.exe
    Wed Apr 01 10:47:35 PDT 2015 Using default number of minutes: 5
    Wed Apr 01 10:47:35 PDT 2015 You can use "SleepTester -minutes 10" to have it sleep for 10 minutes, for example.
    Wed Apr 01 10:47:35 PDT 2015 JVM Version: 25.40-b25 Windows Version: Windows 8
    Wed Apr 01 10:47:35 PDT 2015 The program will now wait for 5 minutes.  Expect wrap-up at Wed Apr 01 10:52:35 PDT 2015
    Wed Apr 01 10:53:38 PDT 2015 The system has come through the Thread.sleep(300000).
    Wed Apr 01 10:53:38 PDT 2015 This should be a low number: 63589
    Wed Apr 01 10:53:38 PDT 2015 This appears to be operating incorrectly...the expected sleep time has NOT been achieved.
    Wed Apr 01 10:53:38 PDT 2015 Program is ending.
    If the process is run on Windows 7, it does not fail:
    Wed Apr 01 17:12:18 EDT 2015 Java Runtime Version: 1.8.0_31-b13 JVM Version: 25.31-b07 Windows Version: Windows 7
    Wed Apr 01 17:12:18 EDT 2015 The program will now wait for 6 minutes.  Expect wrap-up at Wed Apr 01 17:18:18 EDT 2015
    Wed Apr 01 17:18:18 EDT 2015 The system has come through the Thread.sleep(360000).
    Wed Apr 01 17:18:18 EDT 2015 This should be a low number: 0
    Wed Apr 01 17:18:18 EDT 2015 Program is ending.
    This is the guts of  test program:
    [code]
    public static void main(String[] args) throws Exception {
       System.out.println(new Date() + " Java Runtime Version: " + System.getProperty("java.runtime.version") + " JVM Version: " + System.getProperty("java.vm.version") + " Windows Version: " + System.getProperty("os.name"));
       long msDelay = mMinutes * 60 * 1000;
       long wakePoint = new Date().getTime() + msDelay;
       System.out.println(new Date() + " The program will now wait for " + mMinutes + " minutes. Expect wrap-up at " + new Date(wakePoint));
       Thread.sleep(msDelay); // If the machine goes into S3 during this interval, it should not matter, as long as it's awake when it fires.
       System.out.println(new Date() + " The system has come through the Thread.sleep(" + msDelay + "). ");
       long msAccuracy = Math.abs(new Date().getTime() - wakePoint);
       System.out.println(new Date() + " This should be a low number: " + msAccuracy);
       if (msAccuracy > 1000) System.out.println(new Date() + " This appears to be operating incorrectly...the expected sleep time has NOT been achieved.");
       System.out.println(new Date() + " Program is ending.");
    [/code]
    Was the change in behavior from earlier versions of Windows intentional?  Is it something that the JVM is controlling, or is there a difference in the underlying OS that is beyond the control of the JVM?

    I might need to create a work-around whereby I maintain a watch of the msDelay and the system clock.  If there is a discontinuity (which would only happen on Windows 8 or higher), then I would repair the msDelay value.
    A separate (but related) question:
    Can I conclude that since older JVM's running on Windows 8 still have the problem, that it's a Windows issue, and not a JVM issue?

  • Java thread sleeps forever

    i am using the following code the problem i am facing is that the thread does not return from sleep only in one condition.can any one guide me regarding this.
    can i know in what condition the java thread does not return after sleep.
    while(ivIsActive)
    // call some functions
    try
    Thread.currentThread().sleep(ivSleepTime * 1000);
    catch (InterruptedException iException)
    { //............     }

    wait (even with a timeout) and sleep really have
    rather different functions and I'd be disinclined to
    use wait where sleep was appropriate.If you ever what a sleep() to finish early use a wait().
    If you try to interrupt a sleep there is no guarentee that this will not interrrupt in an unexpected place. With wiat you can be sure only thread waiting on a given object will receive the notify.
    I almost never use sleep in preference for wait for this reason.
    I consider it unwise to place much dependence on a notify not occuring, A notify should occur when you execute it. If you don't call notify, it doesn't.
    you might use wait/notify on the object in question for some unrelated purpose
    in different threads, forgetting this sleep. The notify should signify that a change has occured. The code should then test what has changed and what it should do about it. If you use this approach there is little impact in using the same notify for different purposes. If this is of real concern and you can use a dedicated object for notifying a change in the isAlive state (and make it private)
    (I invariably use while tests before wait, rather than if tests).Could you clarify this point?
    I think wait(time) should be regarded as a semaphore wait with timeout.I agreee. An if you want a Thread.run() loop to exit in a timely fashion then wait() is the thing to use. If you it is a requirement that the loop exit after the 30 second, then use sleep();
    Anyway, as to the original problem I think you need
    to make 500% sure that ivSleepTIme is what you think
    it is (because I'd be extremely surprised if it is).
    This is probably a good place for an assertion.I would also check that isAlive is really changing. It is not uncommon to be changing the isAlive in another context, or another object, or not at all.

  • Servlets, Threads, sleep and wait

    Hi,
    I am new to servlet programming and have a problem.
    I want to create a servlet that is also Runnable. It should hold the HTTP request open, and then wait() or sleep(), waking up regularly to send data to the client.
    My code seems to work OK, and in the server logs I can see the debug messages where my servlet is sleeping and waking up. However, it doesn't keep the connection open. Instead, any clients that try to connect instantly receive an empty response.
    Can anyone explain why this is? I am a bit lost. Is the server (Tomcat) cutting my request off when I start to sleep or what?
    dave

    OK. Now seems like I have it working with sleep().
    I was doing something pretty dumb and assuming that a new HttpServlet instance was created for every request - doing things like this.request = request; - obviously this didn't work too wlell ;-)
    Now just using Thread.sleep() it works much better
    One more question - how can I get a separate servlet to call notify() on this servlet so that it wakes up and delivers its message? (I know I need to call wait() not sleep())
    Thanks
    dave

  • How to show surveys name and responses under curret subsite by Java object model in the CEWP

    Hi All,
    I need to show the name of surveys, their description and all responses against the survey  under my current sub-site.
    As I think there is no such out of box web-part available in SharePoint 2010.
    1. Can I get it by using java script client object model and place that in CEWP?
    2. Could I get code for this need?
    Naimish

    Sorry For late reply, I have managed to get needed out put.
    Thank you Hemendra.
    =====================
    <script ='/_layouts/SP.js' type='text/javascript'>
    ExecuteOrDelayUntilScriptLoaded(retrieveAllListProperties, "sp.js"); 
    function retrieveAllListProperties() {
        var clientContext = new SP.ClientContext.get_current();;
        var oWebsite = clientContext.get_web();
        this.collList = oWebsite.get_lists();
        clientContext.load(collList);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
        var listInfo = '';
        var str="";
        var columns = 3;
        var listEnumerator = collList.getEnumerator();
        str += '<table  style="width:1000px" border="1" cellspacing="1" cellpadding="5">'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Survey Title' + '</td>'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' + 'Survey Description' + '</td>'
        str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Total Responses'+ '</td>'   
        while (listEnumerator.moveNext()) 
            var oList = listEnumerator.get_current();
            if(oList.get_baseType() == 4)
            {   str += '<tr>'
                //listInfo += 'Survey Title: '+oList.get_title() +'------'+' Description: '+oList.get_description() +'------'+ ' Total Responses: ' + oList.get_itemCount();
                str += '<td>' +  oList.get_title() + '</td>'
                str += '<td>' +  oList.get_description() + '</td>'
                str += '<td>' +  oList.get_itemCount() + '</td>'
                str += '<tr>'
                str += '</tr>'
        str += '</table>'   
        document.getElementById("demo").innerHTML = str;
    function onQueryFailed(sender, args) {
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
     <span id="demo" style="float:left;">Survey</span>

  • Replace the wait with java embedding thread.sleep() function

    Hi,
    How to replace the wait with java embedding thread.sleep() function. Can anyone help.
    Thanks.

    drag and drop the java embedding component
    include the following code in it.
    try{ 
    Thread.sleep(60000);
    }catch(Exception e)
    --Prasanna                                                                                                                                                                                                                                                                                                                           

  • Realtime equivalent to Java's Thread.sleep()?

    I have an application that I want to guarantee that when I call Java's Thread.sleep(n) the thread will sleep for precisely that amount of time, or close to it at least. What we recently encountered though was that if the "wall clock" time is changed in one thread while a sleep is occurring in another thread, this clock change will impact when the sleeping thread will wake up.
    In our case, we had a simple Thread.sleep(1000), and during that one second period another thread set the clock back two minutes. The sleeping thread ended up sleeping roughly two minutes and a second instead of just a second. Apparently this is a "feature" of Thread.sleep(), and I can see in some cases (e.g. a task scheduler based on wall clock times) where this is exactly the behavior you'd want. However, in our case, we want the sleep function to sleep by the amount we specify, regardless of changes to the wall clock time. Is there a way to do this in Java? We are using JDK 1.5.

    You can use methods which rely on the nanoTime() (based on the number of clock cycles since the processor last reset)
    Classes such as LockSupport.parkUntil(someObject, nanoTime) may give you the accuracy/consistency you want. In this case you always wait the full delay.(and not unpack it)

  • Basic query in JAVA Threads....Please reply !!

    I have a class (say ABC) which extends Thread...This class basically
    reads some file which provides some start-time and stop-time information..
    File structure is like:-
    ===========================================
    <Entry1>Starttime = A and Stoptime = B
    ===========================================
    Logic is that thread sleeps till time A arrived, then do some operations (which are written
    in it's run() method) till stoptime..
    The object of ABC class is being constructed in some other class.
    Now there is a change....File can have multiple entries like..
    ======================================
    <Entry1>starttime = A and stoptime = B
    <Entry2>starttime = X and stoptime = Z
    <Entry3>starttime = A and stoptime = B
    <Entryn>starttime = X and stoptime = Z
    ======================================
    The start-time and stop-time of any two Entries can be same or different.
    The operations should start executing at the defined time..
    In this case, multiple threads are required, which can do the operations
    mentioned in Entry1,2 etc.....But how should it be implemented..
    My query is:-
    1) Can I have a common-wrapper class, which reads the file and based on
    the number of Entries, instantiates that much number of threads...
    But how to do that....I am new to JAVA...Should that class be a simple
    class...or should it also implement Thread/Runnable interface.....
    Or can I implement it as ThreadGroup......
    Please give soem suggestions....Thanks...

    e.g.
            ScheduledExecutorService exec = Executors.newScheduledThreadPool(2);
            exec.schedule(new Runnable() {
                public void run() {
                    runTask();
            }, delay, TimeUnit.MILLISECONDS);

  • Can LabVIEW threads sleep in increments less than a millisecon​d?

    I am aware of two LabVIEW sleep functions:
    1) All Functions | Time & Dialog | "Wait (ms)"
    2) All Functions | Time & Dialog | "Wait Until Next ms Multiple"
    In this day and age, when 3GHz processors sell for less than $200, it seems to me that a millisecond is an eternity. Is there any way to tell your LabVIEW threads to sleep for something less than a millisecond?
    In Java, the standard Thread.sleep() method is written in milliseconds [sorry, the bulletin board software won't let me link directly]:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/​Thread.html#sleep(long)
    but there is a second version of the method that allows for the possiblity of nanoseconds:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/​Thread.html#sleep(long, int)
    So there does seem to be some consensus that millisecond sleep times are getting a little long in the tooth...

    Hi Tarheel !
    May be you should get some idea of the kind of timing accuracy that you can reach when using a loop.
    Use the attached vi, which runs repeatedly a For loop (10 iterations) reading the time, then calculate the average and standard deviation of the time difference between the loop iterations.
    On my PC (P4, 2.6 MHz, W2K), I get a standard deviation of about 8 ms, which appears to be independent of the sleep duration I asked for.
    Same thing with a timed loop.
    Under MacOS X (PowerBook, 1.5GHz), the SD falls down to 0.4 ms.
    I tried to disable most of the background processes running on my PC, but I could not get a better resolution.
    Seems that the issue is not in LV but on the way the OS manage its internal reference clock.
    Since you are a Java afficionado, may be you could produce something equivalent ?
    A proof that nanosecond resolution is available on a PC could be of great help to NI. Why bother with costly timers on DAQ cards ?
    By the way, it took me about one minute to create the attached vi. I would like to have an idea of the time required to do the same thing in Java.
    Tempus fugit...
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Timing precision.zip ‏11 KB

  • Question about java thread implementation

    Hi All,
    I am comparing the performance of the Dining philosopher's problem
    implemented in Java, Ada, C/Pthread, and the experimental language I
    have been working on.
    The algorithm is very simple: let a butler to restrict entry to the
    eating table, so that deadlock is prevented.
    It turns out that the java code is the winner and it is 2 times faster than C!
    The comparison result really surprised me, and raised a big
    question mark : why java runs so fast? I did not use high-level synchronization
    constructs like Semaphores, atomic variables, etc.
    I vaguely recall that Java thread is actually implemented by the underlying
    system thread library(so on linux, the default would be NPTL, on windows NT threads,
    and on Mac OSX it would be Cthread?). Can no longer remember where I read that.
    Does anyone here have some notions about the Java thread
    implementations(where is this formally explained)? or Does anyone know where
    I can possibly find relevant literature or the answer?
    thanks a lot.
    cheers,
    Tony

    Peter__Lawrey wrote:
    google has lots of information on java threaded.
    One thing java does is support biased locking. i.e. the thread which last locked an object can lock that object again faster.
    This may explain the difference. [http://www.google.co.uk/search?q=java+usebiasedlocking]
    Note: you can turn this option off and other locking options to see if a feature is giving you the performance advantage.
    Personally I have found that real world multi-threaded applications are easier to write in Java, esp. when you have a team of developers. For this reason, alot of C/C++ libraries are single threaded, even when there would be a performance advantage in being multi-threaded (because its just too hard in reality to make it thread safe and faster because of it)I didn't know that, very interesting :-)

  • Java Thread run some day then death ,use jstack check it,it  run again, is

    hi all;
    I write a java program run as linux daemon,
    command line is >nohup java myclass &>/dev/null
    it run some day ,then death, ,look like death lock ,but thread not exit
    if i use jstack checke it ,it run again!
    my env is
    Linux version 2.4.20 ,redhat linux
    jstack 14616
    Attaching to process ID 14616, please wait...
    Debugger attached successfully.
    Client compiler detected.
    JVM version is 1.5.0_02-b09
    my program like
    commandline nohuo java StartUp >/dev/null &
    public Class StartUp{
    public static void main(String[] argv){
       Connection con = getDBConnection
         Thread t1 = new Thread(new MyRun(con));
      t1.start();
         Thread t2 = new Thread(new MyRun(con));
      t2.start();
      for(;;){
      Thread.sleep(100);
    public class MyRun implements Runnable{
    Connection con;
    public MyRun(Connection c){con = c;}
    public void run(){
         for(;;){
         object = readData(con);
         process(object);
         log.info("watch info ....");
         Thread.sleep(500);
    }

    Today i found my program hang, i use kill -SIGQUIT to print thead trace
    but i can't find the bug,after send singal ,the thread run again!
    another question
    how to detect a thread is hang?and use another thread restart it?
    thread dump
    Full thread dump Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing):
    "pool-1-thread-2" prio=1 tid=0x08447858 nid=0x5aa6 waiting on condition [0x4680f000..0x4681021c]
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1772)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:470)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:674)
    at java.lang.Thread.run(Thread.java:595)
    "pool-1-thread-1" prio=1 tid=0x08392740 nid=0x5aa5 waiting on condition [0x4678f000..0x4678ff1c]
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1772)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com.ejet.mms.MmsSend.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:595)
    "Low Memory Detector" daemon prio=1 tid=0x080a18b0 nid=0x5a9f runnable [0x00000000..0x00000000]
    "CompilerThread0" daemon prio=1 tid=0x080a0360 nid=0x5a9e waiting on condition [0x00000000..0x417e2c04]
    "Signal Dispatcher" daemon prio=1 tid=0x0809f478 nid=0x5a9d waiting on condition [0x00000000..0x00000000]
    "Finalizer" daemon prio=1 tid=0x080989e8 nid=0x5a9c in Object.wait() [0x413e4000..0x413e441c]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x66c18420> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
    - locked <0x66c18420> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=1 tid=0x08097cf8 nid=0x5a9b in Object.wait() [0x41364000..0x4136451c]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x66c184a0> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:474)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <0x66c184a0> (a java.lang.ref.Reference$Lock)
    "main" prio=1 tid=0x0805ae68 nid=0x5a98 waiting on condition [0xbfffc000..0xbfffc4f8]
    at java.lang.Thread.sleep(Native Method)
    at com.ejet.mms.MmsStartup.main(Unknown Source)
    "VM Thread" prio=1 tid=0x08095218 nid=0x5a9a runnable
    "VM Periodic Task Thread" prio=1 tid=0x080a2d40 nid=0x5aa0 waiting on condition

  • How to install sun studio 12 under Centos 5???

    HI, all,
    I am trying to install Sun Studio 12 into Centos 5. The followings are what I did:
    1. Download sun studio 12 package by selecting Linex (x86) for Centos from web site and save this package under /var/tmp.
    2. I used bzcat to unpack this package by:
    bzcat < SunStudio12ml-linux-x86-200709-pkg.tar.bz2 | /bin/tar xvf -
    3. I did prepare_system before installation by:
    ./prepare_system [-d /opt/sun/ ] [-R /var/tmp/ ] [-C | -s netbeans | java | patches | all_patches | jdk_patches | all | print_needed_steps ]
    where [-d /opt/sun/ ] is the directory where all missing softwares will be installed, [-R /var/tmp/ ] is the directory where unpacked programs are saved.
    After running prepare_system, the resposes are:
    bash: -s: command not found
    bash: patches: command not found
    bash: all_patches: command not found
    bash: all: command not found
    bash: print_needed_steps: command not found
    bash: jdk_patches: command not found
    *Usage: gij [OPTION] ... CLASS [ARGS] ...*
    to invoke CLASS.main, or
    *gij -jar [OPTION] ... JARFILE [ARGS] ...*
    to execute a jar file
    *Try `gij --help' for more information.*
    4. I started to use installer with command line to install the sun studio 12 by:
    ./installer -nodisplay
    The result shows me some exceptions and installation is failed as:
    Exception in thread "Thread-1" java.awt.HeadlessException
    at java.awt.dnd.DropTarget.<init>(libgcj.so.7rh)
    at java.awt.dnd.DropTarget.<init>(libgcj.so.7rh)
    at javax.swing.JComponent.<init>(libgcj.so.7rh)
    at javax.swing.JPanel.<init>(libgcj.so.7rh)
    at javax.swing.JPanel.<init>(libgcj.so.7rh)
    at com.sun.wizards.core.WizardComponent.<init>(WizardComponent.java:159)
    at com.sun.wizards.core.WizardComposite.<init>(WizardComposite.java:83)
    at com.sun.wizards.core.WizardTreeManager.createWizardPanel(WizardTreeManager.java:890)
    at com.sun.wizards.core.WizardTreeManager.<init>(WizardTreeManager.java:325)
    at com.sun.wizards.core.CommandLineConsole.run(CommandLineConsole.java:75)
    at java.lang.Thread.run(libgcj.so.7rh)
    Task Failed: java.lang.NullPointerException
    java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(libgcj.so.7rh)
    at java.util.ResourceBundle.tryBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.tryBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.getBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.getBundle(libgcj.so.7rh)
    at com.sun.setup.util.wbResource.getString(wbResource.java:212)
    at com.sun.setup.util.wbResource.getString(wbResource.java:132)
    at com.sun.setup.util.setupInitializationTask.perform(setupInitializationTask.java:88)
    at com.sun.wizards.core.Sequence.perform(Sequence.java:343)
    at com.sun.wizards.core.SequenceManager.run(SequenceManager.java:226)
    at java.lang.Thread.run(libgcj.so.7rh)
    I followed installation instructions to install sun studio 12 under Centos 5. I can not make it. However, I made it under Solaries system.
    So, is there any special for Centos 5?
    Hunter 3D

    Hi,
    Thank you for your helps.
    According to your suggestions, I downloaded JDK 6 update 10 RC, specifical in Linux platform : self-extracting JDK file named:
    jdk-6u10-bin-b28-linux-i586-21-jul-2008.bin
    I saved downloading under the directory where sun studio is located.
    I used
    yum search jdk
    to find jdk exists in Centos 5.2 shown as the message as:
    [root@localhost sun]# yum search jdk
    Loading "priorities" plugin
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
    * rpmforge: ftp-stud.fht-esslingen.de
    * base: mirror.raystedman.net
    * updates: mirror.raystedman.net
    * addons: mirror.voxitas.com
    * extras: mirror.raystedman.net
    0 packages excluded due to repository priority protections
    jakarta-commons-launcher.i386 : The Launcher Component is designed to be a cross platform Java application launcher.
    jakarta-commons-collections.i386 : Jakarta Commons Collections Package
    mockobjects-alt-jdk1.4.i386 : Mockable API for JDK 1.4
    jakarta-commons-beanutils.i386 : Jakarta Commons BeanUtils Package
    gnu-crypto-sasl-jdk1.4.i386 : Gnu Crypto SASL API
    ldapjdk.i386 : The Mozilla LDAP Java SDK
    ldapjdk-javadoc.i386 : Javadoc for ldapjdk
    mockobjects-jdk1.4.i386 : MockObjects for 1.4 JDK
    I used
    ./installer -nodisplay
    to install sun studio 12 and error message show as:
    [root@localhost sun]# ./installer -nodisplay
    Exception in thread "Thread-1" java.awt.HeadlessException
    at java.awt.dnd.DropTarget.<init>(libgcj.so.7rh)
    at java.awt.dnd.DropTarget.<init>(libgcj.so.7rh)
    at javax.swing.JComponent.<init>(libgcj.so.7rh)
    at javax.swing.JPanel.<init>(libgcj.so.7rh)
    at javax.swing.JPanel.<init>(libgcj.so.7rh)
    at com.sun.wizards.core.WizardComponent.<init>(WizardComponent.java:159)
    at com.sun.wizards.core.WizardComposite.<init>(WizardComposite.java:83)
    at com.sun.wizards.core.WizardTreeManager.createWizardPanel(WizardTreeManager.java:890)
    at com.sun.wizards.core.WizardTreeManager.<init>(WizardTreeManager.java:325)
    at com.sun.wizards.core.CommandLineConsole.run(CommandLineConsole.java:75)
    at java.lang.Thread.run(libgcj.so.7rh)
    Task Failed: java.lang.NullPointerException
    java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(libgcj.so.7rh)
    at java.util.ResourceBundle.tryBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.tryBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.getBundle(libgcj.so.7rh)
    at java.util.ResourceBundle.getBundle(libgcj.so.7rh)
    at com.sun.setup.util.wbResource.getString(wbResource.java:212)
    at com.sun.setup.util.wbResource.getString(wbResource.java:132)
    at com.sun.setup.util.setupInitializationTask.perform(setupInitializationTask.java:88)
    at com.sun.wizards.core.Sequence.perform(Sequence.java:343)
    at com.sun.wizards.core.SequenceManager.run(SequenceManager.java:226)
    at java.lang.Thread.run(libgcj.so.7rh)
    So, please tell me what I will do.
    Thank you.

  • Update jLabel in between Thread.sleep()'s

    I have multiple Thread.sleep()'s in my code under a jButton actionevent evt.
    In between these, I need to be able to update a jLabel, but for some reason it waits until the last thread.sleep() before it updates the jLabel.
    Any ideas why?
    private void jButtonActionPerformed(java.awt.event.ActionEvent evt) {
       try {
          Thread.sleep(1000);
          jLabel.setText("Change Text To This");
          Thread.sleep(1000);
       } catch (InterruptedException ex) {}
    }So rather than waiting 1000ms, then update label, then wait another 1000ms, it just waits 2000ms, then updates the label
    Please help!
    Thanks

    Edward9 wrote:
    I am new to Java and I just cannot work out the tutorials,Hard luck then.
    the code behind my applet doesn't matter as long as it works,Which it will, of you code it correctly after learning from the tutorials.
    I have spend 6 months on this appletWould have taken much less time to learn to do it correctly.
    and everything worksBy your definition of "works"
    apart from this one problem --> jLabel to update between thread.sleep()'s.Easy when you know how.
    Its all I need to do and my project will be over and I can get away from Java.I have a suggestion: why don't you get away from Java right now, take the failing grade you've earned, and get on with your life. Really.
    Is there absolutely no way it can be done?Already covered above and in previous responses.
    I was told the jLabel will not update until the thread is free to do so, so i will need to look up on multiple threads,No, you need to go through the Swing tutorials.
    i have tried to but none of it makes sense to what i need done.Give up. Now.
    db

  • 10 ms overhead when calling Thread.sleep on Linux

    Hi,
    I have been working on a traffic shaping simulation that requires me to send packets on a ms basis. When I call Thread.sleep(11) on Linux 2.4, I get a constant return around 30 ms. I tried to bypass the Thread.sleep function and called directly the select() function under linux with a timeout of 11 ms then I get a constant return around 20 ms. Then if I create a test.c program that loop 100 times calling the select(11), I get a very accurate rate around 10-11 ms. Anyone knows where that 10 ms overhead comes from? I tried executing the java program with Thread.sleep and the -XX:ForceTimeHighResolution but it doesn;t seem to change anything ! Any info would be very welcome ! Thanks

    Actually I get this behavior only on a machine with kernel 2.4. On a different machine with kernel 2.6 I get an accuracy of 10ms for a select call with 10 ms timeout. I know there was some improvements on the jiffy for kernel2.6 but I still don't get why calling select timeout 10ms from a C program return an accuracy of 10ms on linux 2.4 and the same select() timeout 10ms called from java return an accuracy of only 20 ms on kernel 2.4..... :( still looking

Maybe you are looking for

  • Schedule lines of Schedule Agreement

    Hi Friends Can any one please provide me detailed defination of Schedule Lines of the Schedule Agreement. Helpful Answers will be rewarded. Thanks in advance.

  • Solution for 0x80070035 Error When Connecting to Non-Windows Shares

    My situation: Using Windows 7 64-bit OS I needed to connect to two Haas mills.  Both Haas machines have internal hard drives that have been shared and made available to the network.  Using Windows XP we were able to map drives or create shortcuts tha

  • MacBook to XP Networking

    I have a MacBook and PC running Windows XP. Access to the network and internet is using a Verizon FIOS Actiontec router. I can see the MacBook from the PC but cannot see the PC from the MacBook. I have turned off all firewalls (Norton and even the Ac

  • Blog summery page excerpts not displaying in iWeb

    I'm new to iWeb. I've created a blog in my new website but the summery page does not display the excerpts within iWeb (i have selected 5 excerpts to display with the inspector). when i publish the site, the excerpts display on the webpage. But since

  • Oracle 9i linux segmentation fault

    Gentoo linux, installed as suggested at http://www.puschitz.com/OracleOnLinux.shtml#12.... I get lots of these: Errors in file /db/Ora9i/rdbms/log/oradb_ora_1396.trc: ORA-07445: exception encountered: core dump [skgmidrealm()+338] [SIGSEGV] [Addre ss