Re: Derby confuse with SWing Application Framework

2010-06-02 Thread Kristian Waagan

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

2010-05-31 Thread Bryan Pendleton

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

2010-05-31 Thread Kristian Waagan

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
[0x]
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(SocketInputStre

Re: Derby confuse with SWing Application Framework

2010-05-30 Thread Hawkx

>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
[0x]
   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.(Socket.java:375)
at java.net.Socket.(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

Re: Derby confuse with SWing Application Framework

2010-05-27 Thread Kristian Waagan

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

2010-05-26 Thread Hawkx


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

2010-05-21 Thread Hawkx


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

2010-05-20 Thread Bryan Pendleton

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