Deadlock in gui code

My gui code hung and wouldn't respond so I took a thread dump.
I noticed this:
Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
waiting for ownable synchronizer 0x00000007c4535e78, (a java.util.concurrent.locks.ReentrantLock$NonfairSync),
which is held by "AWT-XAWT"
"AWT-XAWT":
waiting to lock monitor 0x0000000041cd7938 (object 0x00000007c44d9418, a java.lang.Object),
which is held by "AWT-EventQueue-0"
Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
     at sun.misc.Unsafe.park(Native Method)
     - parking to wait for <0x00000007c4535e78> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
     at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
     at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
     at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
     at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
     at sun.awt.SunToolkit.awtLock(SunToolkit.java:236)
     at sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(Native Method)
     at sun.awt.X11GraphicsDevice.makeDefaultConfiguration(X11GraphicsDevice.java:210)
     at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:184)
     - locked <0x00000007c44d9418> (a java.lang.Object)
     at java.awt.MouseInfo.areScreenDevicesIndependent(MouseInfo.java:87)
     at java.awt.MouseInfo.getPointerInfo(MouseInfo.java:70)
     at java.awt.Component$2.run(Component.java:1313)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.awt.Component.getMousePosition(Component.java:1310)
     at org.jdesktop.swingx.rollover.RolloverProducer.updateRollover(RolloverProducer.java:173)
     at org.jdesktop.swingx.rollover.RolloverProducer.componentResized(RolloverProducer.java:161)
     at java.awt.AWTEventMulticaster.componentResized(AWTEventMulticaster.java:142)
     at java.awt.Component.processComponentEvent(Component.java:6115)
     at java.awt.Component.processEvent(Component.java:6069)
     at java.awt.Container.processEvent(Container.java:2041)
     at java.awt.Component.dispatchEventImpl(Component.java:4652)
     at java.awt.Container.dispatchEventImpl(Container.java:2099)
     at java.awt.Component.dispatchEvent(Component.java:4482)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
     at java.awt.EventQueue.access$000(EventQueue.java:85)
     at java.awt.EventQueue$1.run(EventQueue.java:603)
     at java.awt.EventQueue$1.run(EventQueue.java:601)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
     at java.awt.EventQueue$2.run(EventQueue.java:617)
     at java.awt.EventQueue$2.run(EventQueue.java:615)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"AWT-XAWT":
     at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:184)
     - waiting to lock <0x00000007c44d9418> (a java.lang.Object)
     at sun.awt.X11.XWindowPeer.checkIfOnNewScreen(XWindowPeer.java:602)
     at sun.awt.X11.XDecoratedPeer.handleConfigureNotifyEvent(XDecoratedPeer.java:809)
     at sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:1129)
     at sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:1086)
     at sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:513)
     at sun.awt.X11.XToolkit.run(XToolkit.java:619)
     at sun.awt.X11.XToolkit.run(XToolkit.java:543)
     at java.lang.Thread.run(Thread.java:662)
Found 1 deadlock.
It looks like a deadlock in the library code. I can't reproduce it.
Has anyone else come across something similar?
Edit: Unbuntu - Java 6 Update 24
Thanks, Nick.
Edited by: Boomah on Jun 23, 2011 10:46 AM

I see the similar (probably same) problem in my GUI.
Here is my EDT and XAWT deadlock under RHEL 5u7 64-bit, JDK 6u30 64-bit:
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
2012-01-10 09:19:05
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.5-b03 mixed mode):
Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
waiting for ownable synchronizer 0x00000000e3ffb940, (a java.util.concurrent.locks.ReentrantLock$NonfairSync),
which is held by "AWT-XAWT"
"AWT-XAWT":
waiting to lock monitor 0x000000004d1c06d8 (object 0x00000000e40448c8, a java.lang.Object),
which is held by "AWT-EventQueue-0"
Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000e3ffb940> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
at sun.awt.SunToolkit.awtLock(SunToolkit.java:234)
at sun.awt.X11GraphicsDevice.getNumConfigs(Native Method)
at sun.awt.X11GraphicsDevice.makeConfigurations(X11GraphicsDevice.java:113)
at sun.awt.X11GraphicsDevice.getConfigurations(X11GraphicsDevice.java:104)
- locked <0x00000000e40448c8> (a java.lang.Object)
at com.sun.awt.AWTUtilities.isWindowTranslucencySupported(AWTUtilities.java:312)
at com.sun.awt.AWTUtilities.isTranslucencySupported(AWTUtilities.java:111)
at javax.swing.RepaintManager.updateWindows(RepaintManager.java:720)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:820)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1636)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:607)
at java.awt.EventQueue$1.run(EventQueue.java:605)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:616)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"AWT-XAWT":
at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:184)
- waiting to lock <0x00000000e40448c8> (a java.lang.Object)
at sun.awt.X11.XWindowPeer.checkIfOnNewScreen(XWindowPeer.java:602)
at sun.awt.X11.XDecoratedPeer.handleConfigureNotifyEvent(XDecoratedPeer.java:809)
at sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:1129)
at sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:1086)
at sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:513)
at sun.awt.X11.XToolkit.run(XToolkit.java:619)
at sun.awt.X11.XToolkit.run(XToolkit.java:543)
at java.lang.Thread.run(Thread.java:662)
Found 1 deadlock.
Heap
PSYoungGen total 25344K, used 8899K [0x00000000e3b60000, 0x00000000e57a0000, 0x0000000100000000)
eden space 21760K, 40% used [0x00000000e3b60000,0x00000000e4410f88,0x00000000e50a0000)
from space 3584K, 0% used [0x00000000e5420000,0x00000000e5420000,0x00000000e57a0000)
to space 3584K, 0% used [0x00000000e50a0000,0x00000000e50a0000,0x00000000e5420000)
PSOldGen total 57984K, used 0K [0x00000000ab200000, 0x00000000aeaa0000, 0x00000000e3b60000)
object space 57984K, 0% used [0x00000000ab200000,0x00000000ab200000,0x00000000aeaa0000)
PSPermGen total 21248K, used 15669K [0x00000000a6000000, 0x00000000a74c0000, 0x00000000ab200000)
object space 21248K, 73% used [0x00000000a6000000,0x00000000a6f4d7f8,0x00000000a74c0000)
Is someone at Oracle looking into this issue?

Similar Messages

  • Hand made or generated GUI code, what do proffesional use?

    Hello!
    I am currious about what programs people that work as a programmer use? Is it common that they use programs that generats code like Netbeens for instance? I tryed that program in design mode to make a gui, but when I looked at the code it had generated I could not understand it. When I have seen simple example of gui code that has been hand written I have no trouble to understand the code.
    My opinion is that code is something that others than yourself can read and understand. Wich ofcource is not as simple as it sounds :) The reason I could not understand Netbeens generated code can ofcource be that I am a java beginner.
    So, what I am asking is that:
    1. Is it common that proffesional programmers use programs like Netbeens to generate GUI code ?
    2. The problem that others cant read or understand the code, is it more common that the programmer have used generated code or does the problem as easly occur when the code is hand written?
    Regards
    Martin
    Edited by: onslow77 on Nov 4, 2009 8:02 AM

    gimbal2 wrote:
    but I prefer hand made code; that generated crap is unreadable (all imho of course) and I don't understand it eitherSeconded. Code generation not only creates messy, undocumented code, but it also leads to hidden mistakes which are the worst kind. I'd rather spend a little more time writing the stuff by hand and not only having full control over the outcome, but also have full knowledge of its inner workings.Thirded. For my money, if you're building rich GUIs that are anything other than trivial, it's probably worth investing some effort in writing a layer of code to simplify building those GUIs. Working with vast amounts of raw Swing, for example, is a painful experience. For our Swing products, we've got a whole library of controls we built specific to our apps. We also wrote a layer of abstraction over the whole of Swing itself, but that's another story. Another alternative is to use a Rich Client Platform like Eclipse RCP, which provides a lot of common, rich components, and a framework for deploying them in, out of the box. Both the Eclipse and NetBeans IDEs are built upon their own respective RCP packages, which are available for you to use for your own apps. All those nice editors, drag-n-drop views, trees, menus, shortcuts and what-not, all just there for you to use without having to write any tiresome window-resizing code. Lovely. I don't know about IntelliJ, but I wouldn't be surprised if it, too, did so. Spring RCP is another such package.

  • "Deadlock in safepoint code. Should have called back to the VM"

    We experience a VM crash in Safepoint.cpp with the following message:
    # An unexpected error has been detected by Java Runtime Environment:
    # Internal Error (safepoint.cpp:558), pid=5452, tid=1900
    # Error: Deadlock in safepoint code. Should have called back to the VM before blocking.
    # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode windows-x86)
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    This happens in JRE 1.6.0.11 + Microsoft VS2008 C++, on Windows Server 2003. Happens in a busy customer site once in every few days, cannot reporoduce in the lab.
    There are two relevant threads:
    * Thread A: Created in Java right after system start up. It makes some preparations and then calls C++ code via JNI. In the JNI, Java data types are converted to C++ data types by GetBooleanArrayElements() and GetStringUTFChars(). It remains in C++ forever (until shutdown) and calls back the Java code via JNI every few seconds (that is: the stack contains Java frames, then C++ frames, then from time to time more Java frames and even further C++ frames).
    * Thread B: Created upon need, invokes a C++ function via JNI, converts parameters by GetStringUTFChars() and at return by ReleaseStringUTFChars(). The function may take few milliseconds and up to few minutes to complete, eventually it returns to Java and the thread is deleted.
    At time of crash we see the following:
    * Most of the threads in the system are in state threadblocked - we guess that the VM blocked them for GC.
    * Thread A is the active one. As far as we can tell it is in Java (called back from C++), maybe trying to invoke a C++ function via JNI. It locked and released a mutex ("synchronized") just before the crash (we suspect that while performing this lock its thread's Safepoint state may have changed to callback). The thread state is threadin_native_trans.
    * Thread B is blocked in the JNI trying to return to Java, maybe while invoking ReleaseStringUTFChars(). It's state is threadblocked.
    Another important detail: the crash happens usually certain time (few seconds or even few minutes) after thread B is blocked, and always while thread A is in Java called back from C++. We guess that something caused the Safepoint locking to wait forever while thread B tried to returns to from C++ to Java, and that the activity of thread A make the Safepoint realize that there's a deadlock (so its activity it's not the root cause but a side-effect).
    We always see two mutex / monitors with name UNKNOWN at time of error, and 100% "eden" memory utilization.
    hotspot error dump fragment:
    --------------- T H R E A D ---------------
    Current thread (0x26d51400): JavaThread "DialogicBridge" [_thread_in_native_trans, id=1900, stack(0x28490000,0x284e0000)]
    Stack: [0x28490000,0x284e0000]
    [error occurred during error reporting (printing stack bounds), id 0xc0000005]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j telemessage.telephony.DialogicBridge.initializeDialogic(Ljava/lang/String;IIIIIIIIIIIILjava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;IZZ[Z)I+0
    j telemessage.telephony.DialogicBridge$1.run()V+293
    j java.lang.Thread.run()V+11
    v ~StubRoutines::call_stub
    0x2ed00400 JavaThread "<< Call#16207 >> " [_thread_blocked, id=8604, stack(0x2e5c0000,0x2e610000)] // this is thread B
    =>0x26d51400 JavaThread "DialogicBridge" [_thread_in_native_trans, id=1900, stack(0x28490000,0x284e0000)] // this is thread A
    Other Threads:
    0x269f7000 VMThread [stack: 0x26a80000,0x26ad0000] [id=2104]
    0x26a29000 WatcherThread [stack: 0x26cb0000,0x26d00000] [id=9300]
    VM state:synchronizing (normal execution)
    VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
    [0x002a8be0] UNKNOWN - owner thread: 0x269f7000
    [0x002a9040] UNKNOWN - owner thread: 0x2ed00400
    Heap
    def new generation total 2816K, used 2707K [0x02730000, 0x02a30000, 0x04e90000)
    eden space 2560K, 100% used [0x02730000, 0x029b0000, 0x029b0000)
    from space 256K, 57% used [0x029f0000, 0x02a14f50, 0x02a30000)
    to space 256K, 0% used [0x029b0000, 0x029b0000, 0x029f0000)
    tenured generation total 30272K, used 17667K [0x04e90000, 0x06c20000, 0x22730000)
    the space 30272K, 58% used [0x04e90000, 0x05fd0d88, 0x05fd0e00, 0x06c20000)
    compacting perm gen total 12288K, used 10995K [0x22730000, 0x23330000, 0x26730000)
    the space 12288K, 89% used [0x22730000, 0x231ecdf8, 0x231ece00, 0x23330000)
    No shared spaces configured.

    Thanks for the advice.
    Eventually (after few days of digging) we found that in certain case we're using the JNIEnv of one thread in the other thread. This leads to sporadic crashes. We managed to simulate the situation in the lab and ensure that fixing the JNIEnv mixture really makes the problem go away.

  • Spliting GUI code to multiple classes

    Hi All...
    I am trying to design a large scale GUI, and after reading several MVC articles I still have some question on writing the GUI code.
    for flexability I split the code to classes:
    1) How can I notify on event(exp: actionPerformed), to other widgets located in separated classes which not visible(I attached a code describing this issue, every class would be in separated class)
    Note
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    class BaseComp1 implements ActionListener{
        JButton button1;
        public void actionPerformed(ActionEvent e){
            // notify DrawingArea instance, an action performed
    class BaseComp2 implements ActionListener{
        JButton button2;
        public void actionPerformed(ActionEvent e){
            // notify DrawingArea instance, an action performed
    public class MainComp{ 
        BaseComp1 base1 ;
        BaseComp2 base2;
        public MainComp(){
            base1 = new BaseComp1();
            base2 = new BaseComp2();
    public class drawingArea{
        public void drawStuff(){  // draw stuff when actionPerform in one of BaseComp* instance
    public class GUI{
        drawingArea drawing;
        MainComp mainComp;
        public GUI(){       // need to connect BaseComp* instances in MainComp instance to
                            // notify drawingArea on actionPerform event
            drawing = new drawingArea();
            mainComp = new MainComp();
    }2) If a solution is available but not recommended, is the preferred coding design for large GUI is to write all of it in the same class ?? any suggestion will excepted joyfully..
    I would like to thanks in advance for any help
    Best Regards
    YyYo
    Edited by: YyYo on May 25, 2010 12:35 PM
    Edited by: YyYo on May 25, 2010 12:36 PM

    First of all, I think your code would improve if you don't have GUI classes implement Action or control interfaces. You may wish to have your controls in separate classes.

  • Fatal deadlock in safepoint code

    I got the following exception when benchmarking WLS 6.1 SP1 on HPUX11.0.
              This exception resulted in an outage in one of the WLS instances in the
              cluster. Unfortunately, this problem doesn't happen often. It happened once
              after a 10 hour run and once after a 4 hour run. It also appears to happen
              when we are benchmarking under heavy loads. This exception also only
              occurred twice in a three week testing window. In other words, it is
              difficult to recreate. However, we are looking for a solution.
              # Java version:
              # Java HotSpot(TM) Server VM (mixed mode)
              # HotSpot Virtual Machine Error, Internal Error
              # Fatal: Deadlock in safepoint code. stopped at 00000000
              # Error ID:
              /CLO/Components/JAVA_HOTSPOT/Src/build/hp-ux/../../src/share/vm/runtime/safe
              point.cpp, 297
              # Problematic Thread: prio=3 tid=0x00490b70 nid=18 lwp_id=17514 runnable
              I am running JDK "1.3.1.00-release-010607-19:35-PA_RISC2.0" which comes with
              the WLS 6.1 SP1 distribution. I am tempted to try JDK 1.3.1.01 which is the
              latest from HP. Only problem is we try to stay compliant with BEA's
              recommended JVM. Any thoughts on that?
              My config is three HP L3000s (4 cpus each) - one is the DB server and two
              are the appl servers. The appl servers are only running at about 50-70% busy
              with lots of free physical memory. My JVM settings are
              JAVA_OPTIONS="-server -verbosegc -XX:NewSize=128m -XX:MaxNewSize=128m -XX:Su
              rviv
              orRatio=2 -Xms512m -Xmx512m"
              Looking at the HP Java release notes, I tried turning
              on -XX:+UseCompilerSafepoint. The doc on safe point follows.
              -XX:+UseCompilerSafepoints
              Enables compiler safe points. In this version, compiler safe points is off
              by default. Enabling compiler safepoints guarantees a more deterministic
              delay to stop all running java threads before doing a safepoint operation,
              namely garbage collection and deoptimization. For patch information, see
              "Known Problems" in these release notes.
              Unfortunately, soon (about 10 minutes) after starting up the WLS cluster, we
              got the following exception
              ========================================================================
              An unexpected exception has been detected in native code outside the VM.
              Unexpected Signal : 10 occurred at PC=0xd04190
              Function name=(N/A)
              Library=(N/A)
              NOTE: We are unable to locate the function name symbol for the error
              just occurred. Please refer to release documentation for possible
              reason and solutions.
              Current Java thread:
              "ExecuteThread: '5' for queue: 'default'" daemon prio=2 tid=0x00456040
              nid=17 lwp_id=21726 runnable [0x00000000..0x589b3478]
              Dynamic libraries:
              /app1/wl6dncp/bea/jdk131/jre/bin/../bin/PA_RISC2.0/native_threads/java
              text:0x00001000-0x00006644 data:0x00007000-0x00007324
              /app1/wl6dncp/bea/jdk131/jre/bin/../lib/PA_RISC2.0/server/libjvm.sl
              text:0xc2c00000-0xc33ba000 data:0x7f71a000-0x7f7cf000
              /usr/lib/libpthread.1
              text:0xc11a0000-0xc11b6000 data:0x7f6e7000-0x7f6ea000
              /usr/lib/libm.2
              text:0xc02c0000-0xc02e6000 data:0x7f6ea000-0x7f6f0000
              /usr/lib/libcl.2
              text:0xc0e40000-0xc0f17000 data:0x7f6f1000-0x7f70f000
              /usr/lib/libisamstub.1
              text:0xc00ce000-0xc00cf000 data:0x7f6f0000-0x7f6f1000
              /usr/lib/libCsup.2
              text:0xc1460000-0xc147b000 data:0x7f70f000-0x7f712000
              /usr/lib/libc.2
              text:0xc0100000-0xc0228000 data:0x7f7d0000-0x7f7e7000
              /usr/lib/libdld.2
              text:0xc0003000-0xc0005000 data:0x7f7cf000-0x7f7d0000
              /app1/wl6dncp/bea/jdk131/jre/lib/PA_RISC2.0/native_threads/libhpi.sl
              text:0xc0fa0000-0xc0fb1000 data:0x7f6e6000-0x7f6e7000
              /app1/wl6dncp/bea/jdk131/jre/bin/../lib/PA_RISC2.0/libverify.sl
              text:0xc1140000-0xc1150000 data:0x7f6d4000-0x7f6d5000
              /app1/wl6dncp/bea/jdk131/jre/bin/../lib/PA_RISC2.0/libjava.sl
              text:0xc1150000-0xc117c000 data:0x7f6cf000-0x7f6d4000
              /app1/wl6dncp/bea/jdk131/jre/bin/../lib/PA_RISC2.0/libzip.sl
              text:0xc1180000-0xc1193000 data:0x7f6cd000-0x7f6cf000
              /app1/wl6dncp/bea/jdk131/jre/bin/../lib/PA_RISC2.0/libnet.sl
              text:0xc0f34000-0xc0f3d000 data:0x7f42c000-0x7f42d000
              /usr/lib/libnss_dns.1
              text:0xc00c8000-0xc00cc000 data:0x7f429000-0x7f42a000
              /usr/lib/libnss_nis.1
              text:0xc0008000-0xc000e000 data:0x7f428000-0x7f429000
              /usr/lib/libnsl.1
              text:0xc0240000-0xc02bb000 data:0x58d3a000-0x58dff000
              /usr/lib/libxti.2
              text:0xc00b0000-0xc00c5000 data:0x7f423000-0x7f428000
              /usr/lib/libnss_files.1
              text:0xc0028000-0xc002f000 data:0x7f422000-0x7f423000
              /app1/wl6dncp/bea/wlserver6.1/lib/hpux11/libmuxer.sl
              text:0xc0979000-0xc097c000 data:0x7f421000-0x7f422000
              /app1/wl6dncp/bea/wlserver6.1/lib/hpux11/libweblogicunix1.sl
              text:0xc00cf000-0xc00d0000 data:0x7f420000-0x7f421000
              /usr/lib/libnsl_s.2
              text:0xc2910000-0xc2924000 data:0x7f419000-0x7f41e000
              /usr/lib/libC.2
              text:0xc24e0000-0xc24fd000 data:0x7f41e000-0x7f420000
              Local Time = Wed Oct 31 13:20:37 2001
              Elapsed Time = 493
              # The exception above was detected in native code outside the VM
              # Java VM: Java HotSpot(TM) Server VM (1.3.1
              1.3.1.00-release-010607-19:35-PA_RISC2.0 PA2.0 mixed mode)
              ========================================================================
              The -XX:+UseCompilerSafepoint option requires patch PHKL_24943. See doc
              below.
              HotSpot Compiler Safe Points
              NOTE: For both HP-UX 11.0 and 11i, using Compiler Safe Points requires a
              patch. The required patches are shown below. For information on locating and
              installing the patches, go to the "Installation" section in this document.
              HP-UX 11.0 PHKL_24943
              HP-UX 11i PHKL_24751
              In this version, compiler safe points is off by default. To turn it on, use
              the -XX:+UseCompilerSafepoints option. Enabling compiler safepoints
              guarantees a more deterministic delay to stop all running java threads
              before doing a safepoint operation, namely garbage collection and
              deoptimization.
              Unfortunately, PHKL_24943 was recalled. See below.
              HP-UX 11.00 PA-RISC Patches
              NOTE: Several of the patches shown below have dependency patches. On the web
              page from which you download the patch, click the "dependency" link and make
              sure you install the dependency patches as well.
              PHCO_23792
              PHCO_23963
              PHCO_24148
              PHKL_18543
              PHKL_23226
              PHKL_23409
              PHKL_24826
              PHKL_24943*
              PHKL_25188
              PHNE_21731
              PHNE_23456
              PHNE_24034
              PHSS_23440
              *PHKL_24943 has been recalled. A replacement patch will be available shortly
              and will be posted here as soon as it is available.
              The long and the short of it. Has anybody in HPUX land run across this issue
              before in production and what workaround have you come up with.
              TIA
              Bernie
              

    I also encounter this problem, does you resolve it or not? If you did, please tell me what should I do.
              Thanks very much
              

  • Gui code design question ...

    Hi
    I need some designtip. Im doing a gui with tabs. Due to lots of lines of code when setting up each tab, the gui class rows is now heading towards infinity. Additionally the actionperformed method from all the buttons, jtexts and textareas on the tabs ... is also growing towards infinity.
    Simply put: I need design tips from the javamasters. Im quite bad at these kinds of design issues.
    A subquestion is also if there is any tutorials/books/howtos on how to come up with excellent designs, making the coding sweet.
    Thanks in advance !!!

    Hello,
    the topic of this thread is basically Gui code design. So, first of all, i recommend to understand the MVC-pattern, as it is the first step to get an understanding of reusable gui code. The Observer-pattern is no substitute for the MVC-pattern, but the MVC-pattern implies the Observer-pattern. Any MVC related topic will lead you in a second step to the Observer-pattern (see also The Core Java Technologies Tech Tip of January 13, 2006: http://java.sun.com/developer/JDCTechTips/2006/tt0113.html).
    Here are three classes (compiled with Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)), which demonstrate the Observer-pattern in a very simplified way due to the shortness of code:
    The SubjectPanel which notifies the registered ObserverPanel:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class SubjectPanel extends JPanel {
      private JTextField textfield = new JTextField("<Type some text>");
      private ChangeListener listener;
      public SubjectPanel(ChangeListener l) {
        listener = l;
        setLayout(new BorderLayout());
        add(textfield, BorderLayout.CENTER);
        textfield.setSelectionStart(0);
        textfield.setSelectionEnd(textfield.getText().length());
        textfield.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            // notify the listener about the changed text
            listener.stateChanged(new ChangeEvent(textfield));
    }The ObserverPanel which wants to be notified when a change in SubjectPanel occures:
    import java.awt.BorderLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class ObserverPanel extends JPanel implements ChangeListener {
      private JLabel label = new JLabel();
      public ObserverPanel() {
        label.setBorder(BorderFactory.createEtchedBorder());
        setLayout(new BorderLayout());
        add(label, BorderLayout.CENTER);
      // Implementation of ChangeListener. This method is called by SubjectPanel
      // if the text has changed.
      public void stateChanged(ChangeEvent e) {
        label.setText(((JTextField)e.getSource()).getText());
    }The main class which contains SubjectPanel and ObserverPanel (Note, that this class doesn't know anything about the communication between the embedded panels):
    import java.awt.GridLayout;
    import javax.swing.JFrame;
    import javax.swing.WindowConstants;
    public class AppFrame extends JFrame {
      private SubjectPanel subjectPanel;
      private ObserverPanel observerPanel;
      public AppFrame() {
        setTitle("Observer");
        observerPanel = new ObserverPanel();
        // By passing the ObserverPanel to the SubjectPanel
        // a "one way communication line" is established
        subjectPanel = new SubjectPanel(observerPanel);
        getContentPane().setLayout(new GridLayout());
        getContentPane().add(subjectPanel);
        getContentPane().add(observerPanel);
      public static void main(String[] args) {
        AppFrame frame = new AppFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }Please, be aware of the fact, that due to the simplification this example lacks the model which is part of the MVC-pattern. The SubjectPanel represents the Controller and the ObserverPanel the View.

  • How to generate GUI code from parsed XML file?

    hai,
    I have to generate GUI code after parsing any configuration XML file as input.Now i have parsed my XML file and got its attributed and i want to get some idea of how to map the parsed XML attributes to the java code to build GUI code.

    Hello,
    1. I like to create data type from a XML file structure, which contains the data structure ?
    XML fields will need to be taken note of to see which is repeating or not. You can also load the XML into a third-party tool such as Altova XML Spy and then generate an XSD from there. You will need to import the XSDs into PI under external definitions. However, this does not guarantee business interoperability, as such, it is always best to ask the provider for the XSDs or WSDL. It will also save you a lot of time from guessing which fields are needed or not.
    2. How to create custom node function in graphical mapping editor ?
    In your graphical mapping editor, on the lowest left corner, there is an icon there that says Create New Function. You must take into account their return types:
    1. Single Values = String
    2. Queue/Context (no return type) thus resultList is used.
    Hope this helps,
    Mark

  • Swing gui code generator

    Since I find Swing LayoutManagers very hard to learn, I would like to know if there is something like a swing gui code generator....
    kevin

    All of the IDEs have WYSIWYG GUI editors where you can interactively change a layout manager and see the effect instantly.
    Check out: Forte, JBuilder or VisualCafe - and, no doubt, a multitude of others.

  • Making Java GUI code open source?

    Hi I am a beginner to Java. I was wondering if this was possible.
    Say I write a calculator applet to host on my website for other users to use. Can I make just the GUI code open source so users can modify the appearance of the applet and then save the GUI code to their usernames on the web server, so the next time they logon, the changed calculator appearance will be stored on the web server already. However, the core code should remain the same so new users who sign up won't be using some else's Calculator GUI code.

    IIRC correctly, most databases support storing binary data, so they should be able to store class files. But then you'd have to extract that class file to someplace where it can run everytime. You're probably better off just storing the class files in a separate dir and whopping up a page that uses user info to determine the correct class to load.
    But I agree with malcolmmc that it doesn't make much sense to have people upload their code to your server.

  • Swing component fires an event to non-GUI code

    Hi all -- this is my first post in forums.sun.com.
    Question to get me started -
    I have a Swing component that fires an ActionEvent. I would like that ActionEvent to trigger code that does not run on the AWT Event Queue thread (some code that will take some time without impacting GUI rendering performance.)
    I know I could put that Event's action command into a synchronized Queue, and have a worker thread checking the queue and taking action when it finds a command there. Likewise, I could flag a volatile boolean as true, and have a worker thread check the flag and take action when true.
    Or (and I suspect this is best), I could create a new SwingWorker thread right in actionPerformed().
    Any opinions on what makes sense?

    pkwooster: Yep. That's what I meant.
    As for the design pattern, Observer was the pattern I was intending to use (and have already implemented). Would anyone argue that another method is more efficient or "correct"?
    My sample project is:
    Business Object -> Main Dialog -> Embedded Dialog
    The Main Dialog contains no business logic - just simple navigation events. The Embedded Dialog contains the real controls and reports any interaction using Swing events, which the Main Dialog picks up.
    I then set up the Observer pattern between the Main Dialog and the Business Object.

  • What is a good GUI code

    Hi,
    at time i writing a gui client for my application.
    the problem is that i don't realy know what code for guicode will be better:
    all code (everey button, label, bar etc.) inside one "open" method.
    with this solution i can change the autput (such as text etc.) of Labels and buttons at runtime.
    a another solution is
    that every button label etc gets it own create method.
    with this solution i have small simple methods, but i have to call them in the right order at the open method. I also have to create the buttons labels etc as fields so they can be changed during runtime.
    (with runtime i mean changes of label texts etc. during userinteraction)
    which solution will be better, for a OO Design/Model.
    or is there a better solution you prefer?
    thanks.
    your sincerely Gideon

    Since you are interested in good OO design, I would highly recommend some reading like "Design Patterns Explained" by Alan Shalloway. Some might push you into the GoF (Gang of Four) book but start easy.
    One tenant of good OO is to encapsulate. So, in your GUI, I would recommend the getters and setters for each widget. Yes, this means a field for each widget on your panel. This is also great for maintenance. Nothing worse than scrolling through a huge method trying to figure out what is going on. So start off with getters/setters for each widget. Then have an initialize method (or something like that) that will add everything on your panel. Try to group like behavior/actions together.
    Now, in my applications, I'm using a MDI application. That means my JFrame has JInternalFrames. My JInternalFrames in turn instantiate JPanels. In a couple of cases, I have multiple JInternalFrames calling the same JPanel. And because I like to have standardized behavior, I use mediators to handle enabling/disabling/clearing of fields, etc. But start off small and work your way into some design patterns.
    I hope this helps.

  • Same gui code 2 different results in xp and 7

    First Machine:Xp,netbeans 6.8, jdk 6 update 19(upgraded due to that problem)
    Second Machine:7,netbeans 6.7.1, jdk 6 update 17
    Image1: http://img686.imageshack.us/img686/5781/gui1.jpg
    Image2: http://img30.imageshack.us/img30/3751/gui2y.jpg
    Here is the code:
    public class MyFrame extends JFrame{
    public Point point1;
    public Point point2;
    private ImageIcon imc;
    private ImageIcon imc2;
    private final Color c1 = Color.green;
    private final Color c2 = Color.cyan;
    private final Color c3 = Color.yellow;
    private final Color c4 = Color.red;
    public MyFrame(Point p1,Point p2,String filename1,String filename2){
    super("xxx");
    imc = new ImageIcon(filename1);
    imc2 = new ImageIcon(filename2);
    point1 = p1;
    point2 = p2;
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLabel emptyLabel = new JLabel("");
    emptyLabel.setPreferredSize(new Dimension(850,650));
    getContentPane().add(emptyLabel, BorderLayout.CENTER);
    //Display the window.
    pack();
    setVisible(true);
    @Override
    public void paint(Graphics g){
    g.setColor( c2 );
    g.fillRect(50, 100, 750, 500);
    g.setColor( c1 );
    g.fillRect( 150, 200, 550, 300 );
    g.setColor( c3 );
    g.drawRect( 100, 150, 650, 400 );
    g.setColor( c4 );
    g.drawLine( 425, 500, 425, 600 );
    imc.paintIcon(this, g, point1.x, point1.y);
    imc2.paintIcon(this, g, point2.x, point2.y);
    }Any solution for that?
    Thanks in advance.
    Edited by: kapodistrias on Mar 31, 2010 12:06 AM

    Really thanks.
    But I think if I had not run it in another machine I would have thought that it was right.
    I have done all the backround but I still cannot add the 2 image icons.
    I tried these inside the jpanel after the background but it seems they don't work.
    Image imc3 = imc.getImage();
    g.drawImage(imc3, point1.x, point1.y, this);
    or
    imc.paintIcon(mypanel, g, point1.x, point1.y);
        public class MyPanel extends JPanel{
            public MyPanel(){
                add(new JLabel(""), BorderLayout.CENTER);
                this.setBackground(c1);
            @Override
            public void paintComponent(Graphics g){
                super.paintComponent(g);
                g.setColor( c2 );
                g.fillRect(50, 100, 750, 500);
                g.setColor( c1 );
                g.fillRect( 150, 200, 550, 300 );
                g.setColor( c3 );
                g.drawRect( 100, 150, 650, 400 );
                g.setColor( c4 );
                g.drawLine( 425, 500, 425, 600 );
                Image imc3 = imc.getImage();
                g.drawImage(imc3, 0, 0, this);
                //imc.paintIcon(mypanel, g, point1.x, point1.y);
                //imc2.paintIcon(mypanel, g, point2.x, point2.y);
        }

  • Sunstudio 11 locks the system up when debugging GUI code

    Since I haven't seen any answers to this problem, here it is again. I have an application that is GUI driven. I am running Sunstudio 11 on Solaris 8/sparc. To debug the application I set a breakpoint and start the program in the sunstudio debugger, when the breakpoint is reached, execution stops. I click on sunstudio to start single stepping and then both sunstudio and the program I am debugging become unresponsive. When I click on the console the whole system become unresponsive and I have to rlogin from another machine to kill the programs.
    Has anyone else seen this happen? Any ideas on what to try to kick these into becoming responsive again?
    Thanks.

    This sounds like the famous "X windows screen grab" problem.
    http://www.gtk.org/faq/#AEN462
    Your application uses a toolkit that probably supports some sort
    of "synchronous" command line option to unlock the screen most of the time.
    Here is another link:
    http://sourceware.org/ml/bug-gdb/2000-09/msg00039.html
    --chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • What is better/easier  GUI Interface and Code

    I'm trying to write a GUI interface that will constantly update a bunch of variables with whatever the user inputs. Is it better to make a GUI and then try to pass the updates back to other underlying code which is in seperate Classes and methods or is it better to combine the two with the updates right in the GUI code itself.
    Right now I have made the basics of the GUI but I haven't really implemented any underlying code (I've made the robot but I don't have the servos to make it move -- as an analogy). Comments?

    Ideal system design has separation between the view and the underlying data model. Preferrably there is a 3rd intermediary, a controller. That's the MVC design pattern. However, how far you implement that pattern depends on the purpose of the program and the complexity of the data model. A simple program you can probably just implement it all right there in the GUI. It won't follow proper software development principles, but we have those so we can deal with large, complex systems. Another thing to consider is what the user input is used for. If it is not required beyond the GUI then I'd say put it in the GUI (since iot really is part of the GUI). But if it's to be used somewhere else, pass the data to the model.

  • Are you all for DB code in GUI?

    I am working on a project where the company who makes the object oriented database we use told us to put the DB calls in the Swing GUI objects for performance reasons.
    The senior engineers on the project at the time (I came later) didn't put up a red flag that: 1. that significantly ties us to their DB (how convenient) and 2. maybe that just means we need to use a different DB if we should buck industry standards to use it effectivily.
    I was the first to buck their idea and I implemented DAO pattern. I literally had to argue with those who have been working here before me because I did this.
    So I ask, is it me or are my points 1 & 2 above valid no matter what the DB company says? Are there valid situations you can see for putting the DB code in the GUI on a project with 10 developers (just to give a relative size of the project)? I just need a reality check since the people I work with don't agree.
    Oh, yeah, and by the way, we have a Swing application that hits the central DB AND a web app that does as well. Of course there is some functionality that is to be displayed in both apps but not all functionality is repeated. Maybe that will help with your decision as well.
    thanks.

    These guys have their heads way up their asses. You are right. This is not going to cause performance issues. In fact if you aren't really careful, putting this is the GUI code is going to screw up the performance of the GUI.
    I don't know where your coworkers are getting these ideas from but they are patently absurd. Good for you for sticking to your guns. I know this can be extremely frustrating.
    If you are really taking heat on this, you should but the burden of proof on the people who are making these claims. Ask them how this will improve performance.

Maybe you are looking for