You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Hawkx <ha...@163.com> on 2010/05/21 05:31:26 UTC

Derby confuse with SWing Application Framework

Sorry, my english is poor, I try to explain that problem I reached.

I write a program using SAF, and I want to start derby server for my
purpose, then I wrote:
  @Action
  public void startServer() {
    try {
      PrintWriter pw = new PrintWriter(System.out);
      InetAddress ia = InetAddress.getByName("172.22.25.210");
      NetworkServerControl serverControl = new NetworkServerControl(ia,
1527);
      serverControl.start(pw);
      System.out.println(serverControl.getSysinfo());
      //serverControl.shutdown();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Then I found my program blocked on
"System.out.println(serverControl.getSysinfo());"
And I found that any function call to serverControl will be blocked after
.start()
Only one way, using 127.0.0.1 for derby could run normally.

Thanks for any help!

-- 
View this message in context: http://old.nabble.com/Derby-confuse-with-SWing-Application-Framework-tp28629315p28629315.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Derby confuse with SWing Application Framework

Posted by Bryan Pendleton <bp...@gmail.com>.
On 05/30/2010 08:46 PM, Hawkx wrote:

> 	at java.net.SocketInputStream.socketRead0(Native Method)
> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
> 	at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:88)
> 	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
> 	at java.net.Socket.connect(Socket.java:529)

Does this indicate that there is a SOCKS proxy in use?

Perhaps there is a problem with communications via the SOCKS proxy.

Can you configure your application to run without the SOCKS proxy, at least
for experimental testing, to isolate whether that is the source of the problem?

thanks,

bryan

Re: Derby confuse with SWing Application Framework

Posted by Kristian Waagan <Kr...@Sun.COM>.
On 31.05.10 10:58, Kristian Waagan wrote:
> On 31.05.10 05:46, Hawkx wrote:
>>> Maybe there is a problem on you machine, or maybe it is a bug in Derby.
>>> It would be helpful if you could do what Bryan suggested - obtain the
>>> stack trace from the Java process when it is hanging.
>>> Besides from what Bryan mentioned, you can also use jstack (or 
>>> visualvm)
>>> to do this.
>> jstack message while blocking:
>
> Hi,
>
> I can't see why this shouldn't work, and I'm afraid I only have some 
> more general comments and suggestions:
>   - should we add a timeout to the socket creation in the various 
> commands? (ping(), sysinfo(), etc)

See also this related issue:
https://issues.apache.org/jira/browse/DERBY-1467 ("It would be useful to 
have a NetworkServerControl start API that took a timeout parameter")


-- 
Kristian

>   - when the application is hanging, are you able to connect to the 
> network server using a separate process, like ij?
>   - what happens if you start the network server stand alone? Is the 
> application then able to complete the sysinfo-call?
>
> As far as I can see, the sysinfo-call is awaiting a response from the 
> server.
> The server process accepting connections (ClientThread) is still doing 
> ServerSocket.accept().
> Could this be a threading problem because of AWT? (i.e., another task 
> is waiting for the event queue, which is stuck in the socket call?)
>
>


Re: Derby confuse with SWing Application Framework

Posted by Kristian Waagan <Kr...@Sun.COM>.
On 31.05.10 05:46, Hawkx wrote:
>    
>> Maybe there is a problem on you machine, or maybe it is a bug in Derby.
>> It would be helpful if you could do what Bryan suggested - obtain the
>> stack trace from the Java process when it is hanging.
>> Besides from what Bryan mentioned, you can also use jstack (or visualvm)
>> to do this.
>>      
> jstack message while blocking:
>    

Hi,

I can't see why this shouldn't work, and I'm afraid I only have some 
more general comments and suggestions:
   - should we add a timeout to the socket creation in the various 
commands? (ping(), sysinfo(), etc)
   - when the application is hanging, are you able to connect to the 
network server using a separate process, like ij?
   - what happens if you start the network server stand alone? Is the 
application then able to complete the sysinfo-call?

As far as I can see, the sysinfo-call is awaiting a response from the 
server.
The server process accepting connections (ClientThread) is still doing 
ServerSocket.accept().
Could this be a threading problem because of AWT? (i.e., another task is 
waiting for the event queue, which is stuck in the socket call?)


-- 
Kristian

> 2010-05-31 11:42:35
> Full thread dump Java HotSpot(TM) Client VM (16.2-b04 mixed mode, sharing):
>
> "NetworkServerThread_4" daemon prio=6 tid=0x02ed6800 nid=0x33c8 runnable
> [0x0481f000]
>     java.lang.Thread.State: RUNNABLE
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
> 	- locked<0x22ad2c08>  (a java.net.SocksSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:453)
> 	at java.net.ServerSocket.accept(ServerSocket.java:421)
> 	at org.apache.derby.impl.drda.ClientThread$1.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.derby.impl.drda.ClientThread.run(Unknown Source)
>
> "derby.NetworkServerStarter" daemon prio=6 tid=0x02ed0400 nid=0x25ac in
> Object.wait() [0x045ef000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x22ab0598>  (a java.lang.Object)
> 	at java.lang.Object.wait(Object.java:485)
> 	at
> org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown
> Source)
> 	- locked<0x22ab0598>  (a java.lang.Object)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.derby.iapi.jdbc.DRDAServerStarter.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "Timer-0" daemon prio=6 tid=0x02f93800 nid=0x2c80 in Object.wait()
> [0x0459f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x22a01958>  (a java.util.TaskQueue)
> 	at java.lang.Object.wait(Object.java:485)
> 	at java.util.TimerThread.mainLoop(Timer.java:483)
> 	- locked<0x22a01958>  (a java.util.TaskQueue)
> 	at java.util.TimerThread.run(Timer.java:462)
>
> "derby.antiGC" daemon prio=2 tid=0x02c15c00 nid=0x5388 in Object.wait()
> [0x03f1f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x28095170>  (a org.apache.derby.impl.services.monitor.AntiGC)
> 	at java.lang.Object.wait(Object.java:485)
> 	at org.apache.derby.impl.services.monitor.AntiGC.run(Unknown Source)
> 	- locked<0x28095170>  (a org.apache.derby.impl.services.monitor.AntiGC)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "TimerQueue" daemon prio=6 tid=0x02f0cc00 nid=0x165c in Object.wait()
> [0x0380f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x280951e8>  (a javax.swing.TimerQueue)
> 	at javax.swing.TimerQueue.run(TimerQueue.java:232)
> 	- locked<0x280951e8>  (a javax.swing.TimerQueue)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "D3D Screen Updater" daemon prio=8 tid=0x02f71800 nid=0x20b8 in
> Object.wait() [0x03f7f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x28015448>  (a java.lang.Object)
> 	at
> sun.java2d.d3d.D3DScreenUpdateManager.run(D3DScreenUpdateManager.java:421)
> 	- locked<0x28015448>  (a java.lang.Object)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "DestroyJavaVM" prio=6 tid=0x00316800 nid=0x2c84 waiting on condition
> [0x00000000]
>     java.lang.Thread.State: RUNNABLE
>
> "AWT-EventQueue-0" prio=6 tid=0x02c3ec00 nid=0x223c runnable [0x034ce000]
>     java.lang.Thread.State: RUNNABLE
> 	at java.net.SocketInputStream.socketRead0(Native Method)
> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
> 	at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:88)
> 	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
> 	at java.net.Socket.connect(Socket.java:529)
> 	at java.net.Socket.connect(Socket.java:478)
> 	at java.net.Socket.<init>(Socket.java:375)
> 	at java.net.Socket.<init>(Socket.java:218)
> 	at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:212)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl$6.run(Unknown
> Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(Unknown
> Source)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.sysinfo(Unknown
> Source)
> 	at org.apache.derby.drda.NetworkServerControl.getSysinfo(Unknown Source)
> 	at
> testderbyblocking.TestDerbyBlockingView.tetstDerbyBlocking(TestDerbyBlockingView.java:212)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
> 	at
> org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
> 	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
> 	at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
> 	at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
> 	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
> 	at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
> 	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
> 	at java.awt.Component.processMouseEvent(Component.java:6263)
> 	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
> 	at java.awt.Component.processEvent(Component.java:6028)
> 	at java.awt.Container.processEvent(Container.java:2041)
> 	at java.awt.Component.dispatchEventImpl(Component.java:4630)
> 	at java.awt.Container.dispatchEventImpl(Container.java:2099)
> 	at java.awt.Component.dispatchEvent(Component.java:4460)
> 	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
> 	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
> 	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
> 	at java.awt.Container.dispatchEventImpl(Container.java:2085)
> 	at java.awt.Window.dispatchEventImpl(Window.java:2478)
> 	at java.awt.Component.dispatchEvent(Component.java:4460)
> 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
> 	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-Windows" daemon prio=6 tid=0x02c3d400 nid=0xd10 runnable [0x0323f000]
>     java.lang.Thread.State: RUNNABLE
> 	at sun.awt.windows.WToolkit.eventLoop(Native Method)
> 	at sun.awt.windows.WToolkit.run(WToolkit.java:295)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "AWT-Shutdown" prio=6 tid=0x02c3bc00 nid=0x4820 in Object.wait()
> [0x031ef000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x27f96ff0>  (a java.lang.Object)
> 	at java.lang.Object.wait(Object.java:485)
> 	at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
> 	- locked<0x27f96ff0>  (a java.lang.Object)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "Java2D Disposer" daemon prio=10 tid=0x02c3b800 nid=0xac in Object.wait()
> [0x0319f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x27f97080>  (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
> 	- locked<0x27f97080>  (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
> 	at sun.java2d.Disposer.run(Disposer.java:125)
> 	at java.lang.Thread.run(Thread.java:619)
>
> "Low Memory Detector" daemon prio=6 tid=0x02ba9800 nid=0x4920 runnable
> [0x00000000]
>     java.lang.Thread.State: RUNNABLE
>
> "CompilerThread0" daemon prio=10 tid=0x02ba3800 nid=0x2984 waiting on
> condition [0x00000000]
>     java.lang.Thread.State: RUNNABLE
>
> "Attach Listener" daemon prio=10 tid=0x02ba2000 nid=0x2cf4 waiting on
> condition [0x00000000]
>     java.lang.Thread.State: RUNNABLE
>
> "Signal Dispatcher" daemon prio=10 tid=0x02ba0c00 nid=0x525c runnable
> [0x00000000]
>     java.lang.Thread.State: RUNNABLE
>
> "Finalizer" daemon prio=8 tid=0x02b60000 nid=0x336c in Object.wait()
> [0x02d2f000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x27f972b0>  (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
> 	- locked<0x27f972b0>  (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
> 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
>
> "Reference Handler" daemon prio=10 tid=0x02b5b400 nid=0x4804 in
> Object.wait() [0x02cdf000]
>     java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on<0x27f96df0>  (a java.lang.ref.Reference$Lock)
> 	at java.lang.Object.wait(Object.java:485)
> 	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
> 	- locked<0x27f96df0>  (a java.lang.ref.Reference$Lock)
>
> "VM Thread" prio=10 tid=0x02b5a000 nid=0x125c runnable
>
> "VM Periodic Task Thread" prio=10 tid=0x02bb9000 nid=0x534 waiting on
> condition
>
> JNI global references: 1267
>
>
>    


Re: Derby confuse with SWing Application Framework

Posted by Hawkx <ha...@163.com>.
>Maybe there is a problem on you machine, or maybe it is a bug in Derby.
>It would be helpful if you could do what Bryan suggested - obtain the 
>stack trace from the Java process when it is hanging.
>Besides from what Bryan mentioned, you can also use jstack (or visualvm) 
>to do this.

jstack message while blocking:

2010-05-31 11:42:35
Full thread dump Java HotSpot(TM) Client VM (16.2-b04 mixed mode, sharing):

"NetworkServerThread_4" daemon prio=6 tid=0x02ed6800 nid=0x33c8 runnable
[0x0481f000]
   java.lang.Thread.State: RUNNABLE
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
	- locked <0x22ad2c08> (a java.net.SocksSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:453)
	at java.net.ServerSocket.accept(ServerSocket.java:421)
	at org.apache.derby.impl.drda.ClientThread$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.drda.ClientThread.run(Unknown Source)

"derby.NetworkServerStarter" daemon prio=6 tid=0x02ed0400 nid=0x25ac in
Object.wait() [0x045ef000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22ab0598> (a java.lang.Object)
	at java.lang.Object.wait(Object.java:485)
	at
org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown
Source)
	- locked <0x22ab0598> (a java.lang.Object)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.derby.iapi.jdbc.DRDAServerStarter.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:619)

"Timer-0" daemon prio=6 tid=0x02f93800 nid=0x2c80 in Object.wait()
[0x0459f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22a01958> (a java.util.TaskQueue)
	at java.lang.Object.wait(Object.java:485)
	at java.util.TimerThread.mainLoop(Timer.java:483)
	- locked <0x22a01958> (a java.util.TaskQueue)
	at java.util.TimerThread.run(Timer.java:462)

"derby.antiGC" daemon prio=2 tid=0x02c15c00 nid=0x5388 in Object.wait()
[0x03f1f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x28095170> (a org.apache.derby.impl.services.monitor.AntiGC)
	at java.lang.Object.wait(Object.java:485)
	at org.apache.derby.impl.services.monitor.AntiGC.run(Unknown Source)
	- locked <0x28095170> (a org.apache.derby.impl.services.monitor.AntiGC)
	at java.lang.Thread.run(Thread.java:619)

"TimerQueue" daemon prio=6 tid=0x02f0cc00 nid=0x165c in Object.wait()
[0x0380f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x280951e8> (a javax.swing.TimerQueue)
	at javax.swing.TimerQueue.run(TimerQueue.java:232)
	- locked <0x280951e8> (a javax.swing.TimerQueue)
	at java.lang.Thread.run(Thread.java:619)

"D3D Screen Updater" daemon prio=8 tid=0x02f71800 nid=0x20b8 in
Object.wait() [0x03f7f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x28015448> (a java.lang.Object)
	at
sun.java2d.d3d.D3DScreenUpdateManager.run(D3DScreenUpdateManager.java:421)
	- locked <0x28015448> (a java.lang.Object)
	at java.lang.Thread.run(Thread.java:619)

"DestroyJavaVM" prio=6 tid=0x00316800 nid=0x2c84 waiting on condition
[0x00000000]
   java.lang.Thread.State: RUNNABLE

"AWT-EventQueue-0" prio=6 tid=0x02c3ec00 nid=0x223c runnable [0x034ce000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:88)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
	at java.net.Socket.connect(Socket.java:529)
	at java.net.Socket.connect(Socket.java:478)
	at java.net.Socket.<init>(Socket.java:375)
	at java.net.Socket.<init>(Socket.java:218)
	at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:212)
	at org.apache.derby.impl.drda.NetworkServerControlImpl$6.run(Unknown
Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(Unknown
Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.sysinfo(Unknown
Source)
	at org.apache.derby.drda.NetworkServerControl.getSysinfo(Unknown Source)
	at
testderbyblocking.TestDerbyBlockingView.tetstDerbyBlocking(TestDerbyBlockingView.java:212)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
	at
org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
	at java.awt.Component.processMouseEvent(Component.java:6263)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6028)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	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-Windows" daemon prio=6 tid=0x02c3d400 nid=0xd10 runnable [0x0323f000]
   java.lang.Thread.State: RUNNABLE
	at sun.awt.windows.WToolkit.eventLoop(Native Method)
	at sun.awt.windows.WToolkit.run(WToolkit.java:295)
	at java.lang.Thread.run(Thread.java:619)

"AWT-Shutdown" prio=6 tid=0x02c3bc00 nid=0x4820 in Object.wait()
[0x031ef000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x27f96ff0> (a java.lang.Object)
	at java.lang.Object.wait(Object.java:485)
	at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
	- locked <0x27f96ff0> (a java.lang.Object)
	at java.lang.Thread.run(Thread.java:619)

"Java2D Disposer" daemon prio=10 tid=0x02c3b800 nid=0xac in Object.wait()
[0x0319f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x27f97080> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
	- locked <0x27f97080> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
	at sun.java2d.Disposer.run(Disposer.java:125)
	at java.lang.Thread.run(Thread.java:619)

"Low Memory Detector" daemon prio=6 tid=0x02ba9800 nid=0x4920 runnable
[0x00000000]
   java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x02ba3800 nid=0x2984 waiting on
condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x02ba2000 nid=0x2cf4 waiting on
condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x02ba0c00 nid=0x525c runnable
[0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x02b60000 nid=0x336c in Object.wait()
[0x02d2f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x27f972b0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
	- locked <0x27f972b0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x02b5b400 nid=0x4804 in
Object.wait() [0x02cdf000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x27f96df0> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:485)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
	- locked <0x27f96df0> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=10 tid=0x02b5a000 nid=0x125c runnable 

"VM Periodic Task Thread" prio=10 tid=0x02bb9000 nid=0x534 waiting on
condition 

JNI global references: 1267


-- 
View this message in context: http://old.nabble.com/Derby-confuse-with-SWing-Application-Framework-tp28629315p28726474.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Derby confuse with SWing Application Framework

Posted by Kristian Waagan <Kr...@Sun.COM>.
On 27.05.10 02:50, Hawkx wrote:
>
> Bryan Pendleton-3 wrote:
>    
>> I'm not sure why the block occurred, but when you specified the IP
>> address for your server to listen on, all connection requests must be
>> made to that IP address.
>>
>>      
> Sorry, I'm busy in working these days.
> I make a test at office, It blocking always. I waited for it at least six
> minutes.I press CTRL+C, then it closed without any message.
>
> Thanks for your help.
>
> Enviroment:
> Netbeans Version: NetBeans IDE 6.8 (Build 200912041610)
> Java: 1.6.0_19; Java HotSpot(TM) Client VM 16.2-b04
> System: Windows XP Version 5.1; x86 ; GB18030; zh_CN (nb)
>
> Library:
> appframework-1.0.3
> swing-worker-1.1
> derby-10.6.1
>
> Code:
>    @Action
>    public void testDerbyBlocking() {
>      try {
>        InetAddress ia = InetAddress.getByName("0.0.0.0");
>        NetworkServerControl nsc = new NetworkServerControl(ia, 1527);
>        nsc.start(null);
>        System.out.println(nsc.getSysinfo());
>        nsc.shutdown();
>      } catch (Exception ex) {
>        ex.printStackTrace();
>      }
>    }
>    

Running this test (on OpenSolaris) I see one out of two results:
  a) It succeeds and I see the sysinfo output.
  b) The server hasn't come up when nsc.getSysinfo() is run and I get a 
"Connect refused" error. Adding a short sleep after the start command 
fixes this issue.

Maybe there is a problem on you machine, or maybe it is a bug in Derby.
It would be helpful if you could do what Bryan suggested - obtain the 
stack trace from the Java process when it is hanging.
Besides from what Bryan mentioned, you can also use jstack (or visualvm) 
to do this.


Regards,
-- 
Kristian

Re: Derby confuse with SWing Application Framework

Posted by Hawkx <ha...@163.com>.

Bryan Pendleton-3 wrote:
> 
> I'm not sure why the block occurred, but when you specified the IP
> address for your server to listen on, all connection requests must be
> made to that IP address.
> 

Sorry, I'm busy in working these days.
I make a test at office, It blocking always. I waited for it at least six
minutes.I press CTRL+C, then it closed without any message.

Thanks for your help.

Enviroment:
Netbeans Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_19; Java HotSpot(TM) Client VM 16.2-b04
System: Windows XP Version 5.1; x86 ; GB18030; zh_CN (nb)

Library:
appframework-1.0.3
swing-worker-1.1
derby-10.6.1

Code:
  @Action
  public void testDerbyBlocking() {
    try {
      InetAddress ia = InetAddress.getByName("0.0.0.0");
      NetworkServerControl nsc = new NetworkServerControl(ia, 1527);
      nsc.start(null);
      System.out.println(nsc.getSysinfo());
      nsc.shutdown();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }

-- 
View this message in context: http://old.nabble.com/Derby-confuse-with-SWing-Application-Framework-tp28629315p28688285.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Derby confuse with SWing Application Framework

Posted by Hawkx <ha...@163.com>.

Bryan Pendleton-3 wrote:
> 
> I'm not sure why the block occurred, but when you specified the IP
> address for your server to listen on, all connection requests must be
> made to that IP address.
> 

Surprising, I did a test at home, and it is very favorable. I don't know
what happened.
I will make a try next monday at office.

By the way, I has discarded SAF in my project.

Sorry for my terrible English.

Thanks for your help!
-- 
View this message in context: http://old.nabble.com/Derby-confuse-with-SWing-Application-Framework-tp28629315p28640789.html
Sent from the Apache Derby Developers mailing list archive at Nabble.com.


Re: Derby confuse with SWing Application Framework

Posted by Bryan Pendleton <bp...@gmail.com>.
> I write a program using SAF, and I want to start derby server for my
> purpose, then I wrote:

I'm not sure why the block occurred, but when you specified the IP
address for your server to listen on, all connection requests must be
made to that IP address.

But I would have expected you to get a "connection refused" error, not a
hang. Perhaps you just didn't wait long enough?

When your program is blocked, try using Ctrl-Break or SIGQUIT (depending
on your operating system) to get a dump of all the thread stack traces,
and post your results to the list, and perhaps somebody will spot some
clues in the thread stack traces.

thanks,

bryan