Thread waits and locks using Solaris 8 T1 threads

Hi,
I have got a problem relating to Webmethods running on JVM Hot Spot server VM (1.4.2_07-b05 mixed mode).
From time to time the webmethods applications seems to slow down and completely lock up with the mpstat on solaris showing:
1. context switching increases (csw)
2. spin on mutexes also show approximately 25 % increase (smtx)
The only way i could overcome this problem is to kill the process - which incidentally produces a thread dump. Incidentally i have also done a pstack on the process.
The thread dump shows among other things alots of object waits, with locks on objects in an object Pool. The main process is in a waiting state on object, locked by itself, similarly other thread deamon are also in a waiting state on objects which itself has locked. Seems rather wierd (dont understand that).
Anyway we are on Solaris 8 -using the T1 solaris thread library. My question is whether we need to move to T2 solaris thread library and use the option of -XX:-UseLWPSynchronization on JVM would help in the long run. As i am quire new to the JVM Hot Spot (excuse my lack of knowledge in this sphere), i am also posting the thread dump or parts of it here - I am reading them as dead locks but i could be wrong, would also appreciate some help on this matter to clarify what i am reading:
"IS <ENERGYAUST#wm.ip.ebxml.MSH:process>" prio=5 tid=0x00a2e570 nid=0x12c in Object.wait() [63f7e000..63f819c0]
     at java.lang.Object.wait(Native Method)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.pool.ObjectPool.allocate(ObjectPool.java:248)
     - locked <0x97835bf8> (a java.lang.Object)
     at com.wm.util.pool.ObjectPool.allocate(ObjectPool.java:191)
     at com.wm.app.b2b.server.ThreadManager.runTarget(ThreadManager.java:83)
     at com.wm.app.b2b.server.ThreadManager.runTarget(ThreadManager.java:62)
     at com.wm.app.b2b.server.control.ControlledThreadPool.runTarget(ControlledThreadPool.java:359)
     at wm.ip.ebxml.coder.util.getEnvelopeStream(util.java:588)
     at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:635)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:584)
     at com.wm.app.tn.route.RoutingActions.invokeWrapper(RoutingActions.java:959)
     at com.wm.app.tn.route.RoutingActions.invoke(RoutingActions.java:827)
     at wm.tn.route.route(route.java:750)
     at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:635)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:584)
     at wm.ip.ebxml.Receiver.processMessage(Receiver.java:588)
     at wm.ip.ebxml.Receiver.process(Receiver.java:186)
     at wm.ip.ebxml.MSH.process(MSH.java:165)
     at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.ServiceThread.run(ServiceThread.java:82)
     - locked <0xbb1b42e0> (a com.wm.app.b2b.server.ServiceThread)
     at com.wm.util.pool.PooledThread.run(PooledThread.java:105)
     - locked <0x9ad44eb8> (a com.wm.app.b2b.server.TMPooledThread)
     at java.lang.Thread.run(Thread.java:534)
"IS <ENERGYAUST#wm.ip.ebxml.MSH:process>" prio=5 tid=0x00a2d980 nid=0x12b in Object.wait() [6407e000..640819c0]
     at java.lang.Object.wait(Native Method)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.pool.ObjectPool.allocate(ObjectPool.java:248)
     - locked <0x97835bf8> (a java.lang.Object)
     at com.wm.util.pool.ObjectPool.allocate(ObjectPool.java:191)
     at com.wm.app.b2b.server.ThreadManager.runTarget(ThreadManager.java:83)
     at com.wm.app.b2b.server.ThreadManager.runTarget(ThreadManager.java:62)
     at com.wm.app.b2b.server.control.ControlledThreadPool.runTarget(ControlledThreadPool.java:359)
     at wm.ip.ebxml.coder.util.getEnvelopeStream(util.java:588)
     at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:635)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:584)
     at com.wm.app.tn.route.RoutingActions.invokeWrapper(RoutingActions.java:959)
     at com.wm.app.tn.route.RoutingActions.invoke(RoutingActions.java:827)
     at wm.tn.route.route(route.java:750)
     at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:168)
     at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
     at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:581)
     at com.wm.lang.flow.FlowState.step(FlowState.java:438)
     at com.wm.lang.flow.FlowState.invoke(FlowState.java:403)
     at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:982)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:635)
     at com.wm.app.b2b.server.Service.doInvoke(Service.java:584)
     at wm.ip.ebxml.Receiver.processMessage(Receiver.java:588)
     at wm.ip.ebxml.Receiver.process(Receiver.java:186)
     at wm.ip.ebxml.MSH.process(MSH.java:165)
     at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:322)
     at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:612)
     at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
     at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:226)
     at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
     at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:198)
     at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:39)
     at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:411)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:521)
     at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:369)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:246)
     at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:113)
     at com.wm.app.b2b.server.ServiceThread.run(ServiceThread.java:82)
     - locked <0xbb1b4410> (a com.wm.app.b2b.server.ServiceThread)
     at com.wm.util.pool.PooledThread.run(PooledThread.java:105)
     - locked <0x9ad44f30> (a com.wm.app.b2b.server.TMPooledThread)
     at java.lang.Thread.run(Thread.java:534)
"AuditRejectHandler" daemon prio=5 tid=0x009b23c8 nid=0x23 in Object.wait() [73681000..736819c0]
     at java.lang.Object.wait(Native Method)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:74)
     - locked <0x97800e18> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.app.store.impl.TSSimpleQueue._waitForMessage(TSSimpleQueue.java:585)
     at com.wm.app.store.impl.TSSimpleQueue.getWait(TSSimpleQueue.java:464)
     at com.wm.app.store.impl.TSSimpleQueueConsumer.getWait(TSSimpleQueueConsumer.java:37)
     at com.wm.app.audit.AuditFactory$AuditRejectHandler.run(AuditFactory.java:1646)
"AuditRetryHandler" daemon prio=5 tid=0x007bc5c8 nid=0x22 in Object.wait() [73781000..737819c0]
     at java.lang.Object.wait(Native Method)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:74)
     - locked <0x97800ed0> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.app.store.impl.TSSimpleQueue._waitForMessage(TSSimpleQueue.java:585)
     at com.wm.app.store.impl.TSSimpleQueue.getWait(TSSimpleQueue.java:464)
     at com.wm.app.store.impl.TSSimpleQueueConsumer.getWait(TSSimpleQueueConsumer.java:37)
     at com.wm.app.audit.AuditFactory$RetryHandler.run(AuditFactory.java:1495)
"AuditExceptionHandler" daemon prio=5 tid=0x009b1e30 nid=0x21 in Object.wait() [73881000..738819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x97800f90> (a com.wm.util.sync.CountingSemaphore)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:71)
     - locked <0x97800f90> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:56)
     - locked <0x97800f90> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.app.audit.AuditFactory$ExceptionHandler.run(AuditFactory.java:1410)
"AuditProducer0" daemon prio=5 tid=0x009bb4e8 nid=0x20 in Object.wait() [73a81000..73a819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x97801000> (a com.wm.util.sync.CountingSemaphore)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:71)
     - locked <0x97801000> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.app.store.impl.TSSimpleQueue._waitForMessage(TSSimpleQueue.java:585)
     at com.wm.app.store.impl.TSSimpleQueue.getWait(TSSimpleQueue.java:464)
     at com.wm.app.store.impl.TSSimpleQueueConsumer.getWait(TSSimpleQueueConsumer.java:37)
     at com.wm.app.audit.AuditFactory$AuditProducerHandler.run(AuditFactory.java:1576)
"TS-EventHandler" daemon prio=5 tid=0x005c1d20 nid=0x1f in Object.wait() [73981000..739819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x978010c8> (a com.wm.util.sync.LatchedSemaphore)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.sync.LatchedSemaphore.semWait(LatchedSemaphore.java:54)
     - locked <0x978010c8> (a com.wm.util.sync.LatchedSemaphore)
     at com.wm.util.sync.LatchedSemaphore.semWaitReset(LatchedSemaphore.java:101)
     - locked <0x978010c8> (a com.wm.util.sync.LatchedSemaphore)
     at com.wm.app.store.TransientStoreFactory$NotifyHandler.run(TransientStoreFactory.java:2173)
"FSData Free Cache Handler" daemon prio=5 tid=0x006eca38 nid=0x1d in Object.wait() [73b81000..73b819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x97801130> (a com.wm.util.sync.CountingSemaphore)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:71)
     - locked <0x97801130> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:56)
     - locked <0x97801130> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.driver.data.fs.FSData$FreeCacheHandler.run(FSData.java:3976)
"Thread-12" daemon prio=5 tid=0x009bc0a0 nid=0x1c in Object.wait() [73c81000..73c819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x97801140> (a com.wm.app.jdbc.JDBCConnPoolMgr$ConnectionTimeoutMgr)
     at com.wm.app.jdbc.JDBCConnPoolMgr$ConnectionTimeoutMgr.run(JDBCConnPoolMgr.java:394)
     - locked <0x97801140> (a com.wm.app.jdbc.JDBCConnPoolMgr$ConnectionTimeoutMgr)
"FSData Free Cache Handler" daemon prio=5 tid=0x006ebcf0 nid=0x1b in Object.wait() [73d81000..73d819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x978011e8> (a com.wm.util.sync.CountingSemaphore)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:71)
     - locked <0x978011e8> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.util.sync.CountingSemaphore.semWait(CountingSemaphore.java:56)
     - locked <0x978011e8> (a com.wm.util.sync.CountingSemaphore)
     at com.wm.driver.data.fs.FSData$FreeCacheHandler.run(FSData.java:3976)
"Thread-10" daemon prio=5 tid=0x00590d90 nid=0x1a in Object.wait() [73e81000..73e819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x978011f8> (a com.wm.app.repov4.server.RepoServer$RepoLockTimeoutMgr)
     at com.wm.app.repov4.server.RepoServer$RepoLockTimeoutMgr.run(RepoServer.java:1533)
     - locked <0x978011f8> (a com.wm.app.repov4.server.RepoServer$RepoLockTimeoutMgr)
"Thread-9" daemon prio=5 tid=0x000e9f48 nid=0x19 in Object.wait() [74081000..740819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x978012b0> (a com.wm.driver.queue.data.DataQueue)
     at java.lang.Object.wait(Object.java:429)
     at com.wm.driver.queue.data.DataQueue.dequeue(DataQueue.java:310)
     - locked <0x978012b0> (a com.wm.driver.queue.data.DataQueue)
     at com.wm.driver.queue.data.DataQueue.dequeueCommit(DataQueue.java:260)
     - locked <0x978012b0> (a com.wm.driver.queue.data.DataQueue)
     at com.wm.driver.queue.data.DataQueue.dequeueCommit(DataQueue.java:254)
     - locked <0x978012b0> (a com.wm.driver.queue.data.DataQueue)
     at com.wm.app.repov4.server.RepoServerBase$RepoEventManager.run(RepoServerBase.java:224)
"TxnData-Deadlock-Manager" daemon prio=5 tid=0x00799c18 nid=0x14 in Object.wait() [73f81000..73f819c0]
     at java.lang.Object.wait(Native Method)
     - waiting on <0x97801338> (a java.lang.Object)
     at com.wm.util.data.TxnData$DeadlockManager.run(TxnData.java:4945)
     - locked <0x97801338> (a java.lang.Object)
"Thread-2" daemon prio=5 tid=0x00104430 nid=0x12 in Object.wait() [74181000..741819c0]
     at java.lang.Object.wait(Native Method)
     at com.wm.util.queue.FSMTDirValuesHash$VHLockTimeoutMgr.run(FSMTDirValuesHash.java:448)
     - locked <0x978013b0> (a com.wm.util.queue.FSMTDirValuesHash$VHLockTimeoutMgr)
"Log Thread" prio=5 tid=0x002e9f10 nid=0x11 in Object.wait() [74281000..742819c0]
     at java.lang.Object.wait(Native Method)
     at com.wm.util.sync.SimpleQueue.deq(SimpleQueue.java:171)
     - locked <0x97801458> (a com.wm.util.sync.SimpleQueue)
     at com.wm.util.sync.SimpleQueue.deq(SimpleQueue.java:126)
     - locked <0x97801458> (a com.wm.util.sync.SimpleQueue)
     at com.wm.app.b2b.server.ServerLogHandler$LogThread.run(ServerLogHandler.java:274)
"Cron

Hi,
I've just found the following in another thread:
The workaround for the bugID 6221832 (java being in another path than the default /usr/j2se/bin/ for Patch Manager 2.0 on Solaris 8) is to edit the pprosetup and pprosvc scripts
from /usr/sbin/pprosvc :
JAVACMD=/usr/j2se/bin/java
edit pprosetup and pprosvc scripts file and set JAVACMD locale variable to newly java installed path and launch smpatch get command again
Thank you. I've editted both scripts and changed the JAVACMD variable to be ${JAVA_HOME}/bin/java and now everything is working.
Thanks.

Similar Messages

  • Example of WAIT and CONTINUE using checkBox and thread and getTreeLock()

    I had so much trouble with this that I descided to
    post if incase it helps someone else
    // Swing Applet example of WAIT and CONTINUE using checkBox and thread and getTreeLock()
    // Runs form dos window
    // When START button is pressed program increments x and displys it as a JLabel
    // When checkBox WAIT is ticked program waits.
    // When checkBox WAIT is unticked program continues.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class Wc extends JApplet {
    Display canvas;//drawing surface is displayed.
    Box buttonPanel;
    Box msgArea;
    public static JButton button[] = new JButton [2];
    public static JCheckBox checkBox[] = new JCheckBox[2];
    public static JLabel msg[] = new JLabel [2];
    String[] buttonDesc ={"Start","Quit"};
    public static final int buttonStart = 0;
    public static final int buttonQuit = 1;
    String[] checkBoxDesc ={"Wait"};     
    public static final int checkBoxWait = 0;
    public boolean wait;
    public Graphics g;
    //================================================================
    public static void main(String[] args){
    Frame f = new Frame();
    JApplet a = new Wc();
    f.add(a, "Center"); // Add applet to window
    a.init(); // Initialize the applet
    f.setSize(300,100); // Set the size of the window
    f.show(); // Make the window visible
    f.addWindowListener(
    new WindowAdapter(){
    public void windowClosing(WindowEvent e){System.exit(0);}
    }// end main
    //===================================================
    public void init() {
    canvas = new Display();
    setBackground(Color.black);
    getContentPane().setLayout(new BorderLayout(3,3));
    getContentPane().add(canvas, BorderLayout.CENTER);
    buttonPanel = Box.createHorizontalBox();
    getContentPane().add(buttonPanel, BorderLayout.NORTH);
    int sbZ;
    // add button
    button[0] = new JButton(buttonDesc[0]);
    button[0].addActionListener(canvas);
    buttonPanel.add(button[0]);
    button[1] = new JButton(buttonDesc[1]);
    button[1].addActionListener(canvas);
    buttonPanel.add(button[1]);
    // add checkBox
    sbZ=0;
    checkBox[sbZ]=new JCheckBox(checkBoxDesc[sbZ]);
    checkBox[sbZ].setBackground(Color.white);
    checkBox[sbZ].setOpaque(true);
    checkBox[sbZ].addActionListener(canvas);
    buttonPanel.add(checkBox[sbZ]);
    msgArea = Box.createVerticalBox(); // add message
    sbZ=0;
    msg[sbZ]=new JLabel("1",JLabel.LEFT);
    msg[sbZ].setOpaque(true);
    msg[sbZ].setBackground(Color.black);
    msg[sbZ].setForeground(Color.red);
    msgArea.add(msg[sbZ]);
    getContentPane().add(msgArea, BorderLayout.SOUTH);
    } // end init();
    //===================================================
    public void stop(){canvas.stopRunning();}
    //===================================================
    // The following nested class represents the drawing surface
    // of the applet and also does all the work.
    class Display extends JPanel implements ActionListener, Runnable {
    Image OSI;
    Graphics OSG; // A graphics context for drawing on OSI.
    Thread runner; // A thread to do the computation.
    boolean running; // Set to true when the thread is running.
    public void paintComponent(Graphics g) {
    if (OSI == null) {
    g.setColor(Color.black);
    g.fillRect(0,0,getWidth(),getHeight());
    else {g.drawImage(OSI,0,0,null);}
    }//paintComponent
    public void actionPerformed(ActionEvent evt) {
    String command = evt.getActionCommand();
    if (command.equals(buttonDesc[buttonStart])) {
    startRunning();
    if (command.equals(buttonDesc[buttonQuit])) {
    stopRunning();
    if (command.equals(checkBoxDesc[checkBoxWait])){
    System.out.println("cb");
    if (checkBox[checkBoxWait].isSelected() ) {
    wait = true;
    System.out.println("cb selected twait "+wait);
    return;
    wait = false;
    synchronized(getTreeLock()) {getTreeLock().notifyAll();}
    System.out.println("cb selected fwait "+wait);
    } // end command.equal cb wait
    } //end action performed
    // A method that starts the thread unless it is already running.
    void startRunning() {
    if (running)return;
    // Create a thread that will execute run() in this Display class.
    runner = new Thread(this);
    running = true;
    runner.start();
    } //end startRunning
    void stopRunning() {running = false;System.exit(0);}
    public void run() {
    button[buttonStart].setEnabled(false);
    int x;
    x=1;
    while(x>0 && running){
    x = x + 1;
    msg[0].setText(""+x);
    try{SwingUtilities.invokeAndWait(painter);}catch(Exception e){}
    //importand dont put this in actionPerformed
    if (wait) {
    System.out.println("run "+wait);
    synchronized(getTreeLock()) {
    while(wait) {
    System.out.println("while "+wait);
    try {getTreeLock().wait();} catch(Exception e){break;}
    } //end while(wait)
    } // end sync
    } // end if(wait)
    } // endwhile(x>0)
    stopRunning();
    } // end run()
    Runnable painter = new Runnable() {
    public void run() {
    Dimension dim = msg[0].getSize();
    msg[0].paintImmediately(0,0,dim.width,dim.height);
    Thread.yield();
    }//end run in painter
    } ; //end painter
    } //end nested class Display
    } //end class Wc

    I just encountered a similar issue.  I bought a new iPhone5s and sent my iPhone4s for recycling as it was in great shape, no scratches, no breaks, perfect condition.  I expected $200 and received an email that I would only receive $24.12.  The explanation was as follows:  Phone does not power on - Power Supply Error.   Attempts to discuss don't seem to get past a customer service rep that can only "escalate" my concern.  They said I would receive a response, but by email.  After 4 days no response.  There is something seriously wrong with the technical ability of those in the recycling center.

  • Thread waiting to lock on an object that it has already locked

    I have a thread in my thread dump where it is "waiting to lock" on an object, but it already has acquired the lock. How can this be possible?
    "TP-Processor778" daemon prio=1 tid=0x230dde38 nid=0x1168 waiting for monitor entry [0x0f184000..0x0f185fa0]
    at sun.net.www.protocol.file.Handler.openConnection(Handler.java:63)
    - waiting to lock <0x40fbf128> (a sun.net.www.protocol.file.Handler)
    at sun.net.www.protocol.file.Handler.openConnection(Handler.java:55)
    - locked <0x40fbf128> (a sun.net.www.protocol.file.Handler)
    at java.net.URL.openConnection(URL.java:943)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

    If object.wait() is called, an existing lock is released so another thead can lock the object.
    If you object.notify() but hold the lock in another thread, the first thread will not resume until it has required the lock.

  • How to recover lost data from a mac that was erased and locked using findmyiphone app

    Hi,
    My macbook pro was locked and erased using find my iphone app then it was recovered. I entered my pin and unlocked it. I then have the option to reinstall the OS on a new hard drive or my old one (which is blocked).
    What do I do if i want to recover all of my old data?

    Alas the answer is : NO
    If you have an external HD, you may try tun run a recovery tool instlled on this external device searching for keystring "index.xml"
    With a bit of luck, it will retrieve an old copy of your document.
    I hope that this time you will understand that working the way you did is playing with matches.
    Whe you work on a document already saved once, duplicate the document before opening it and check that both copies are OK.
    This way you will have at least a copy containg the datas from the 25 first day.
    During the working session, don't save with the name of the opened doc, save vert ten minutes with different names.
    Doing that you will recover at least the copy which you opened.
    Yvan KOENIG (VALLAURIS, France)  jeudi 10 janvier 2011 21:27:19
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Java thread WAIT(400).. using NetBeans 6.0

    Hi everyone, can someone please help me! Im trying to make something look like a 'loading' bar but I cant
    get this to wait(200)... like for ex:
    I want to ProgressBar1, to load up like 10% and then wait 4 seconds, and load up to 40% but Im not sure how to wait! Look at my code below and please help:
    Look at comments towards middle of the script!
    Please help! -- Thanks
    package my.numberaddition;
    public class NumberAdditionUI extends javax.swing.JFrame{
    public NumberAdditionUI() {
    initComponents();
    jTextField1.setText("");
    jTextField2.setText("");
    jTextField3.setText("");
    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
    jTextField1.setText("");
    jTextField2.setText("");
    jTextField3.setText("");
    jProgressBar1.setValue(0);
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    System.exit(0);
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    float num1,num2,result;
    num1 = Float.parseFloat(jTextField1.getText());
    num2 = Float.parseFloat(jTextField2.getText());
    result = num1 + num2;
    jTextField3.setText(String.valueOf(result));
    jProgressBar1.setValue(40);
    jLabel3.setText("Stablizing");
    Thread.currentThread().sleep(4000); //This is where it should wait!
    jLabel3.setText("Loading Graphics");
    jProgressBar1.setValue(60);
    Thread.currentThread().sleep(4000); //And here!
    jProgressBar1.setValue(95);
    jLabel3.setText("Loading..");
    Thread.currentThread().sleep(2000; ///And finally here
    jProgressBar1.setValue(100);
    jLabel3.setText("Loaded");
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new NumberAdditionUI().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    // End of variables declaration
    }

    I want to ProgressBar1, to load up like 10% and then wait 4 seconds, and load up to 40%Why? Why not have it show the actual progress, in the actual time that it took?
    In other words, just update the ProgressBar every time you get to a significant point. Forget the waiting, make the 'progress' instead.

  • Difference betn  wait() and sleep() method of a thread

    Can anyone briefly differentiate between the sleep() and wait() method of a thread.

    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#sleep(long)]sleep
    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait()]wait

  • Multiple threads but they are using the same thread ID

    I'm a newbie in Java programming. I have the following codes, please take a look and tell me what wrong with my codes: server side written in Java, client side written in C. Please help me out, thanks for your time.
    Here is my problem: why my server program assigns the same thread ID for both threads???
    .Server side: start server program
    .Client side: set auto startup in /etc/rc.local file in a different machine, so whenever this machine boots up, the client program will start automatically.
    ==> here is the result with 2 clients, why they always come up the same thread ID ????????
    Waiting for client ...
    Server thread 1024 running
    Waiting for client ...
    Server thread 1024 running
    But if I do like this, they all work fine:
    .Server side: start server program
    .Client side: telnet or ssh to each machine, start the client program
    ==> here is the result:
    Waiting for client ...
    Server thread 1024 running
    Waiting for client ...
    Server thread 1025 running
    server.java file:
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.util.Hashtable;
    import java.util.Enumeration;
    import java.util.regex.Pattern;
    import java.util.Date;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class Server extends Frame implements Runnable
    private ServerThread clients[] = new ServerThread[50];
    private ServerSocket server = null;
    private Thread thread = null;
    private int clientCount = 0;
    //some variables over here
    public Server(int port)
    //GUI stuffs here
    //network stuff
    try
    System.out.println("Binding to port " + port + ", please wait ...");
    server = new ServerSocket(port);
    System.out.println("Server started: " + server);
    start();
    catch(IOException ioe)
    System.out.println("Can not bind to port " + port + ": " + ioe.getMessage());
    public boolean action(Event e, Object arg)
    //do something
    return true;
    public synchronized void handle(int ID, String input)
    //do something
    public synchronized void remove(int ID)
    int pos = findClient(ID);
    if (pos >= 0)
    //remove a client
    ServerThread toTerminate = clients[pos];
    System.out.println("Removing client thread " + ID + " at " + pos);
    if (pos < clientCount-1)
    for (int i = pos+1; i < clientCount; i++)
    clients[i-1] = clients;
    clientCount--;
    try
    {  toTerminate.close(); }
    catch(IOException ioe)
    {  System.out.println("Error closing thread: " + ioe); }
    toTerminate.stop();
    private void addThread(Socket socket)
    if (clientCount < clients.length)
    clients[clientCount] = new ServerThread(this, socket);
    try
    clients[clientCount].open();
    clients[clientCount].start();
    clientCount++;
    catch(IOException ioe)
    System.out.println("Error opening thread: " + ioe);
    else
    System.out.println("Client refused: maximum " + clients.length + " reached.");
    public void run()
    while (thread != null)
    try
    {       System.out.println("Waiting for a client ...");
    addThread(server.accept());
    catch(IOException ioe)
    System.out.println("Server accept error: " + ioe); stop();
    public void start()
    if(thread == null)
    thread = new Thread(this);
    thread.start();
    public void stop()
    if(thread != null)
    thread.stop();
    thread = null;
    private int findClient(int ID)
    for (int i = 0; i < clientCount; i++)
    if (clients[i].getID() == ID)
    return i;
    return -1;
    public static void main(String args[])
    Frame server = new Server(1500);
    server.setSize(650,400);
    server.setLocation(100,100);
    server.setVisible(true);
    ServerThread.java file
    import java.net.*;
    import java.io.*;
    import java.lang.*;
    public class ServerThread extends Thread
    private Server server = null;
    private Socket socket = null;
    private int ID = -1;
    InputStreamReader objInStreamReader = null;
    BufferedReader objInBuffer = null;
    PrintWriter objOutStream = null;
    public ServerThread(Server server, Socket socket)
    super();
    server = _server;
    socket = _socket;
    ID = socket.getPort();
    public void send(String msg)
    objOutStream.write(msg);
    objOutStream.flush();
    public int getID()
    return ID;
    public void run()
    System.out.println("Server thread " + ID + " running");
    while(true)
    try{
    server.handle(ID,objInBuffer.readLine());
    catch(IOException ioe)
    System.out.println(ID + "Error reading: " + ioe.getMessage());
    //remove a thread ID
    server.remove(ID);
    stop();
    public void open() throws IOException
    //---Set up streams---
    objInStreamReader = new InputStreamReader(socket.getInputStream());
    objInBuffer = new BufferedReader(objInStreamReader);
    objOutStream = new PrintWriter(socket.getOutputStream(), true);
    public void close() throws IOException
    if(socket != null) socket.close();
    if(objInStreamReader != null) objInStreamReader.close();
    if(objOutStream !=null) objOutStream.close();
    if(objInBuffer !=null) objInBuffer.close();
    And client.c file
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <netdb.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <unistd.h> /* close */
    #include <time.h>
    #define SERVER_PORT 1500
    #define MAX_MSG 100
    //global variables
    long lines = 0;
    int sd = 0;
    char command[100];
    time_t t1,t2;
    double timetest = 0.00;
    int main (int argc, char *argv[])
    int rc, i = 0, j = 0;
    struct sockaddr_in localAddr, servAddr;
    struct hostent *h;
    char buf[100];
    FILE *fp;
    h = gethostbyname(argv[1]);
    if(h==NULL) {
    printf("unknown host '%s'\n",argv[1]);
    exit(1);
    servAddr.sin_family = h->h_addrtype;
    memcpy((char *) &servAddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
    servAddr.sin_port = htons(SERVER_PORT);
    /* create socket */
    sd = socket(AF_INET, SOCK_STREAM, 0);
    if(sd<0) {
    perror("cannot open socket ");
    exit(1);
    /* bind any port number */
    localAddr.sin_family = AF_INET;
    localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    localAddr.sin_port = htons(0);
    rc = bind(sd, (struct sockaddr *) &localAddr, sizeof(localAddr));
    if(rc<0) {
    printf("%s: cannot bind port TCP %u\n",argv[1],SERVER_PORT);
    perror("error ");
    exit(1);
    /* connect to server */
    rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));
    if(rc<0) {
    perror("cannot connect ");
    exit(1);
    //send register message
    rc = send(sd, "register\n", strlen("register\n"), 0);
    //if can't send
    if(rc < 0)
    close(sd);
    exit(1);
    //wait here until get the flag from server
    while(1)
    buf[0] = '\0';
    rc = recv(sd,buf,MAX_MSG-1,0);
    if(rc < 0)
    perror("receive error\n");
    close(sd);
    exit(1);
    buf[rc] = '\0';
    if(strcmp(buf,"autoplay")==0)
    //do something here
    else if(strcmp(buf,"exit")==0)
    printf("exiting now ....\n");
    close(sd);
    exit(1);
    return 0;

    Yes......I do so all the time.

  • How to see the Currently loged on user and Locks using Enterpirse manager

    Hello Everybody,
    I want to see using enterpirse manager
    *1.* the currently connected users
    *2.* The locks held by users.
    How to do this in Enterprise manager?
    Regards

    Hello Asif,
    Your and Deepak suggessions do no t show the connected users. Instead If we use the following query,it will give us the names of all users that are currently connected.
    SELECT SUBSTR(s.username,1,15) USERNAME,
    SUBSTR(s.status,1,8) STATUS,
    SUBSTR(s.server,1,10) SERVER,
    SUBSTR(s.type,1,10) TYPE,
    SUBSTR(s.event,1,20) "WAIT EVENT",
    DECODE(s.command,
    1,'Create Table',
    2,'Insert',
    3,'Select',
    6,'Update',
    7,'Delete',
    8,'Drop',
    9,'Create Index',
    10,'Drop Index',
    12,'Drop Table',
    17,'Grant',
    26,'Lock Table',
    42,'Alter Session',
    43,'Alter User',
    44,'Commit',
    45,'Rollback',
    s.command) COMMAND
    FROM v_$session s, v_$session_wait w
    WHERE (s.sid = w.sid)
    AND s.username != 'SYS'
    ORDER BY s.username;
    Best Regards

  • VISA: Parallel threads and locking instruments

    Hello,
    i have 50 instruments that are controlled in two threads running at the same time.
    Thread 1: Only VISA write (configuration of the instruments)
    Thread 2: Visa write and Visa read (read measurement from instrument)
    Can i now simply add the "Visa Lock Async VI" before the write and "Visa Unlock" at the end?
    Thread 1: Visa Lock -> Write -> Visa Unlock
    Thread 2: Visa Lock -> Write -> Read -> Visa Unlock
    Thanks

    It is really best if you can put all of the instrument control into a single thread.  That way you don't have to play these lock-do something-unlock games.  A Queued Message Handler works wonderfully for this situation.  But if you insist on not doing that (I know there are situations where you can't), then a Semaphore is really the way to go.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • Waiting for monitor enty messages in thread dump

    Hi,
    I've a thread dump of a container in a Oracle Application Server 9.0.4.1 (running 1.4.2_07) right before restart because off low memory and a lot of threads in this dump are in this state:
    "AJPRequestHandler-ApplicationServerThread-1588" prio=1 tid=0x37634bf8 nid=0x1982 waiting for monitor entry [43f22000..43f2386c]
    can anyone tell me what this means? Google didn't reveal anything useful.
    Another thing I don't understand although it seems it doesn't do any harm:
    "AJPRequestHandler-ApplicationServerThread-1630" prio=1 tid=0x09011a68 nid=0x1982 in Object.wait() [40276000..4027686c]
    at java.lang.Object.wait(Native Method)
    - waiting on <0x6624e628> (a java.util.HashMap)
    at java.lang.Object.wait(Object.java:429)
    at java.net.InetAddress.checkLookupTable(InetAddress.java:1109)
    - locked <0x6624e628> (a java.util.HashMap)
    at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1048)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1188)
    at com.evermind.server.http.EvermindHttpSession.encodeSession(EvermindHttpSession.java:414)
    at com.evermind.server.http.HttpApplication.createSession(HttpApplication.java:1599)
    why is this thread waiting for a lock itself has?
    Thanx for any help and hints in advance.
    Regards,
    Ingo

    Hi,
    I've a follow-up question, I have the following thread in several thread dumps:
    "AJPRequestHandler-ApplicationServerThread-717" prio=1 tid=0x4046b988 nid=0x3dd3 waiting for monitor entry [3845e000..3845e86c]
         at java.net.Inet4Address.getAddress(Inet4Address.java:287)
         at com.evermind.server.http.StandardRequestLogger.appendIP(StandardRequestLogger.java:187)
         at com.evermind.server.http.StandardRequestLogger.log(StandardRequestLogger.java:45)
         - locked <0x663b2088> (a com.evermind.server.http.StandardRequestLogger)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:906)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    What is the monitor this thread is waiting for? According to the source in Inet4Address at line 287 the method tries to create a new byte array... is there some system monitor which can't be seen in the thread dump?
    This thread holds a lock (0x663b2088) 46 other threads are waiting for...
    Thanx in advance for any hints.
    Regards,
    Ingo

  • Java Thread suspend and resume problem

    Hi,
    I am trying to write a program to implement thread suspend and resume using wait() and notify without using the deprecated methods like resume and suspend.
    I have written the following program which compiles but when I run it hangs without terminating. There seems to be some logic error but I am not able to catch it.
    Please help
    public class TestSuspendResume {
      public static void main(String[] args) {
        MyThread m1= new MyThread("--One-- ");
        MyThread m2= new MyThread("--Two-- ");
        m1.suspendMe();
        try {
          Thread.sleep(1500);
          m1.t.join();
          m2.t.join();
        } catch(InterruptedException e) {
          e.printStackTrace();
        m1.resumeMe();
        System.out.println("Now : end main thread");
    class MyThread implements Runnable {
      boolean suspend = false;
      Thread t;
      MyThread(String name) {
        t = new Thread(this,name);
        t.start();
      void resumeMe() {
        suspend = false;
        notify();
      void suspendMe() {
        suspend = true;
      public void run() {
        try {
          for(int i=0;i<20;i++) {
            System.out.println("Now : "+Thread.currentThread().getName()+i);
            Thread.sleep(200);
            synchronized(this) {
              while(suspend)
                wait();
        } catch(InterruptedException e) {
          e.printStackTrace();
    }

    Thanks for that response. I figured out that was the problem in the logic. I have modified the code to make it simpler but it is still hanging.
    public class TestSuspendResume {
      public static void main(String[] args) {
        MyThread m1= new MyThread("--One-- ");
        try {
          m1.suspendMe();
          Thread.sleep(1000);
        } catch(InterruptedException e) {
          e.printStackTrace();
        try {
          m1.resumeMe();
        } catch(Exception e) {
          System.out.println("ASASAS");
          e.printStackTrace();
        try {
          m1.t.join();
        } catch(InterruptedException e) {
          System.out.println("WOWOW");
          e.printStackTrace();
        System.out.println("Now : end main thread");
    class MyThread implements Runnable {
      boolean suspend = false;
      Thread t;
      MyThread(String name) {
        t = new Thread(this,name);
        t.start();
      void resumeMe() {
        if(suspend==true) {
          suspend = false;
          notify();
      void suspendMe() {
        suspend = true;
      public void run() {
        try {
          for(int i=0;i<20;i++) {
            System.out.println("Now : "+Thread.currentThread().getName()+i);
            Thread.sleep(200);
            synchronized(this) {
              while(suspend)
                wait();
        } catch(InterruptedException e) {
          System.out.println("-- E In run method -- "+e.getMessage());
    }

  • Using Thread in Helper Class Used By MDB

    Using Thread in Helper Class Used By MDB
    I am writting one Message driven bean (MDB) which will be deployed on
    weblogic 6.1.
    In MDB.onMessage I create instance of helper class.
    call it's method HelperClass.doSomething(s1,s2)
    in doSomething I start new thread
    checks if thread is alive
    when thread is dead return flag
    run method of helper class does following
    1. opens socket connection to some server
    2. writes some data to it
    3. read some data from it
    4. depending on response set flag
    I want to know whether this approach is corect.
    Specially when weblogic recommends not to use threads (or be extreamly
    careful about thread handling) .
    Following is code..
    MessageDrivenBeanClass{
         puboic void onMessage(Message msg){
              String s1 = "s1";
              String s2 = "s2";
              HelperClass helper = new HelperClass();
              boolean flg = helper.doSomething(s1,s2);
    HelperClass implements Runnable {
         String s1;
         String s2;
         boolean flg = false;
         public void HelperClass(){}
         public boolean doSomething(String s1, String s2){
              this.s1 = s1;
              this.s2 = s2;
              Thread t1 = new Thread(this);
              t1.start();
              while(true)
              if(!t1.isAlive())
                   break;
              return flg;
         public void run(){
              // do actual processing
              if(something)
                   flg = true;
              else
                   flg = false;

    What is the purpose of creating an extra thread in this scenario (if your
    code is going to wait until thread terminates anyway) ?
    Also, creating new threads can be expensive, so it is always better to use
    thread pool and not to create new thread every time.
    And,
    Thread t1 = new Thread(this);
    t1.start();
    while(true)
    if(!t1.isAlive())
    break;
    is going to waste ALOT of CPU time. t1.join() will work much better.
    sk <[email protected]> wrote:
    Using Thread in Helper Class Used By MDB
    I am writting one Message driven bean (MDB) which will be deployed on
    weblogic 6.1.
    In MDB.onMessage I create instance of helper class.
    call it's method HelperClass.doSomething(s1,s2)
    in doSomething I start new thread
    checks if thread is alive
    when thread is dead return flag
    run method of helper class does following
    1. opens socket connection to some server
    2. writes some data to it
    3. read some data from it
    4. depending on response set flag
    I want to know whether this approach is corect.
    Specially when weblogic recommends not to use threads (or be extreamly
    careful about thread handling) .
    Following is code..
    MessageDrivenBeanClass{
         puboic void onMessage(Message msg){
              String s1 = "s1";
              String s2 = "s2";
              HelperClass helper = new HelperClass();
              boolean flg = helper.doSomething(s1,s2);
    HelperClass implements Runnable {
         String s1;
         String s2;
         boolean flg = false;
         public void HelperClass(){}
         public boolean doSomething(String s1, String s2){
              this.s1 = s1;
              this.s2 = s2;
              Thread t1 = new Thread(this);
              t1.start();
              while(true)
              if(!t1.isAlive())
                   break;
              return flg;
         public void run(){
              // do actual processing
              if(something)
                   flg = true;
              else
                   flg = false;

  • JDK6 locks use a LOT more memory then JDK5

    I'm happy user of java 5 concurrency utilities - especially read/write locks. We have a system with hundreds of thousands of objects (each protected by read/write lock) and hundreds of threads. I have tried to upgrade system to jdk6 today and to my surprise, most of the memory reported by jmap -histo was used by thread locals and locks internal objects...
    As it turns out, in java 5 every lock had just a counter of readers and writers. In java 6, it seems that every lock has a separate thread local for itself - which means that there are 2 objects allocated for each lock for each thread which ever tries to touch it... In our case, memory usage has gone up by 600MB just because of that.
    I have attached small test program below. Running it under jdk5 gives following results:
    Memory at startup 114
    After init 4214
    One thread 4214
    Ten threads 4216With jdk6 it is
    Memory at startup 124
    After init 5398
    One thread 8638
    Ten threads 39450This problem alone makes jdk6 completly unusable for us. What I'm considering is taking ReentranceReadWriteLock implementation from JDK5 and using it with rest of JDK6. There are two basic choices - either renaming it and changing our code to allocate the other class (cleanest from deployment point of view) or putting different version in bootclasspath. Will renaming the class (and moving it to different package) work correctly with jstack/deadlock detection tools, or they are expecting only JDK implementation of Lock ? Is there any code in new jdk depending on particular implementation of RRWL ?
    Why this change was made btw ? Only reason I can see is to not allow threads to release read lock taken by another threads. This is a nice feature, but is it worth wasting gigabyte of heap ? How this would scale to really big number of threads ?
    Test program
    import java.util.concurrent.atomic.AtomicInteger;
    import java.util.concurrent.locks.*;
    public class LockTest {
      static AtomicInteger counter = new AtomicInteger(0);
      static Object foreverLock = new Object();
      public static void main(String[] args) throws Exception {
        dumpMemory("Memory at startup ");
        final ReadWriteLock[] locks = new ReadWriteLock[50000];
        for ( int i =0; i < locks.length; i++ ) {
          locks[i] = new ReentrantReadWriteLock();
        dumpMemory("After init ");
        Runnable run = new Runnable() {
          public void run() {
            for ( int i =0; i< locks.length; i++ ) {
              locks.readLock().lock();
    locks[i].readLock().unlock();
    counter.incrementAndGet();
    synchronized(foreverLock) {
    try {
    foreverLock.wait();
    } catch (InterruptedException e) {
    e.printStackTrace();
    new Thread(run).start();
    while ( counter.get() != 1 ) {
    Thread.sleep(1000);
    dumpMemory("One thread ");
    for ( int i =0; i < 9; i++ ) {
    new Thread(run).start();
    while ( counter.get() != 10 ) {
    Thread.sleep(1000);
    dumpMemory("Ten threads ");
    System.exit(0);
    private static void dumpMemory(String txt ) {
    System.gc();
    System.gc();
    System.gc();
    System.out.println(txt + (Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory())/1024);

    Controlling access/update to data is what DBMS are
    all about.And our framework is more or less DBMS.
    Imagine that you need a SQL database with following extensions:
    If any row you have ever requested is modified, you should get a new version transparently plus get notified about the change (what fields have changed)
    If any query you have ever done would return different rows then previously, the result collection should be modified and you should be notified about the change (delta to previous contents).
    It is distributed-cache-meets-DBMS framework.
    Some of the entities are backed by actual database for persistence, but others are not (they are in transient memory only, or views to data managed by completly different systems).
    We could stay with R/W locks for the lists and plain locks for objects - but even the number of lists in the system (5-10k) could already have some effect when multiplied by the number of threads - and originally the cost for having R/W lock per object was relatively small and it seems cleaner and more scalable.
    Just from top of my head I can give the example where I was searching the list of the objects for the index to insert a new one in write lock, but I have switched to searching this list in read lock, then changing to a write lock and searching area around previously found place (as list could be modified in the moment lock is upgraded, but in most cases I have to search only 1-2 indices around). This change had incredible perceived performance impact (as rendering code for a JTable was using model based on the same list with a readlock). For single object locking it is not so obvious, but still there are objects which can locked for reading from many threads concurrently.

  • How to fix wait and notify

    The program tries to find the first socket connection. Theirs a wait and the notify call in the inner class seams to have to effect. Attach is the code to try out
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import java.nio.channels.*;
    * SocketSearch class to scan for an open socket from an array of sockets passed. <br>
    * Inner class DetectSocketConnection tries to open the socket and assign hostname
    * a value if successful. <br>
    * The SocketSearch thread class is waiting to find the hostname or active DetectSocketConnection
    * threads to be zero - i.e No hosts found
    public class SocketSearch extends Thread {
       private Object syncObject = new Object();
       private String hostname = null;
       private ThreadGroup threadGroup = new ThreadGroup("SOCKETS_CONNECT");
       private ArrayList sockets = null;
        * Inner class DetectSocketConnection to find an open socket. <br>
        * It will assign the hostname a value if successful
       private class DetectSocketConnection extends Thread {
          private SocketChannel sc = null;
          private String host = null;
          private int port = -1;
          public DetectSocketConnection(String host, int port) {
             super(threadGroup, host);
             this.host = host;
             this.port = port;
             System.out.println("DetectSocketConnection::syncObject = " + syncObject);     
          public void run() {
             System.out.println("Scanning " + host + " at port number " + port);
             synchronized(syncObject) {
                try {         
                   InetSocketAddress isa = new InetSocketAddress(InetAddress.getByName(host), port);
                       // Connect
                    sc = SocketChannel.open();
                sc.connect(isa);
                   System.out.println("Found hostname: " + host + "!!!!!!!!!!!!!!!!!!!");
                   hostname = host;
                catch (IOException e) {
                   System.err.println("DetectSocketConnection: " + e.toString());
                finally {
                // Make sure we close the channel (and hence the socket)
                   close();
                   System.out.println("DetectSocketSonnectio: notify()...");
                   syncObject.notify();
          public void close() {
             try {
                if (sc != null) sc.close();
             catch (IOException e) {
       public SocketSearch() {
          sockets = new ArrayList();
        * Add socket to the sockets ArrayList to prepare to start the Socket Search
        * @param host Socket hostname
        * @param port Socket port number
       public void addSocket(String host, int port) {
          DetectSocketConnection detectSocket = new DetectSocketConnection(host, port);
          sockets.add(detectSocket);
        * SocketSearch start method to fire up the sockets threads to search for
       public void start() {
          super.start();
          if (sockets != null) {
             DetectSocketConnection[] arrSockets = (DetectSocketConnection[]) sockets.toArray(new DetectSocketConnection[0]);
             for (int i = 0 ; i < arrSockets.length ; i++) {
                arrSockets.start();
    * Main code to do the socket search
    public void run() {
    try {
    boolean loop = (sockets.size() > 0);
    while (loop) {
    synchronized(syncObject) { 
    System.out.println("SocketSearch.wait() => syncObject = " + syncObject);
    syncObject.wait();
    System.out.println("SocketSearch.wait() => syncObject = " + syncObject + ", finished...");
    if (hostname != null) {     
    // use the hostname
    // you could interrupt the threads now - its your choice
    loop = false;
    else {
    System.out.println("Invalid hostname...");
    ThreadGroup currentGroup = Thread.currentThread().getThreadGroup();
    int numThreads = currentGroup.activeCount();
    Thread[] listOfThreads = new Thread[numThreads];
    currentGroup.enumerate(listOfThreads);
    int activeThreads = 0;
    for (int i = 0 ; i < numThreads ; i++) {
    if (listOfThreads[i] instanceof DetectSocketConnection) {
    activeThreads++;
    System.out.println("activeThreads: " + activeThreads);
    if (activeThreads == 0) {     
    // host name is NULL and active threads are finished
    throw new UnknownHostException("Host not found.");
    if (hostname != null) {
    System.out.println("Found hostname: " + hostname);
    // Do something here, use callback to maybe dispose ProgressDialog etc...
    catch (UnknownHostException e) {
    // Do something here, use callback to maybe dispose ProgressDialog etc...
    System.err.println(e.toString());
    catch (InterruptedException e) {
    // Do something here, use callback to maybe dispose ProgressDialog etc...
    System.err.println(e.toString());
    * Test to find a socket from an array of test socket hosts
    public static void main(String args[]) {
    String[] yahooPOP3PossibleSettings = new String[] {
    "yahoo.com",
    "mail.yahoo.com",
    "pop.yahoo.com",
    "pop.mail.yahoo.com",
    "pop3.yahoo.com"
    int PORT_NUMBER = 110;
    SocketSearch socketSearch = new SocketSearch();
    for (int i = 0 ; i < yahooPOP3PossibleSettings.length ; i++) {
    socketSearch.addSocket(yahooPOP3PossibleSettings[i], PORT_NUMBER);
    socketSearch.start();

    Forget it. The Inner class was doing a wait and so was the main thread.
    Not meant to put a wait in the main thread...

  • Synchronize work from multiple threads using wait() and notifyAll() help

    Hello folks,
    (Sorry for my bad english)
    My current project handles multiple access requests to a shared collection from multiple threads originating from different classess and methods. Therefor I need to keep track of the order in which the Threads access that collection. I wrote a sort of Buffer class that has a static instance entry which initiate a new Instance of my Buffer class, attributes the instance a cue number and return the instance to the caller Thread.(Just like when you go to a supermarket and draw a number to wait to get served at the cheese counter).The callerThread then uses this instance to execute a method within the buffer class. Inside the buffer class method, I want to set a while loop on wait() just like this:
    while(currentCue != myCueState)
    wait();
    when all other prior method calls within my Buffer class are done, the loop should wake up using a notifyAll() call and check the condition "currentCue != myCueState" agen to see if its turn has come.
    I am new to the wait() and notifyAll() stuff and are therefor not sure what I am dooing wrong here: The only way this buffer class finishes all it's cues is when the caller Threads are beeing executed in the same order than they have checked in to the Buffer class. Otherwise I get some sort of dead-lock in the middle. Here is my code for the Buffer class:
    public class Buffer{
        private static int currentCue = 0;
        private static int lastCued = 0;
        private int myCueState;
        private Buffer myInstance = null;
        synchronized void doTaskOne(){      
            try{
                while(currentCue != myCueState)
                    wait();           
                //Do your task now
                System.out.println("doTaskOne got Executed: "+currentCue);
                currentCue++;
                notifyAll();
            catch(Exception a){}
        synchronized void doTaskTwo(){
             try{
                while(currentCue != myCueState)
                    wait();
                //Do your task now
                System.out.println("doTaskTwo got Executed: "+currentCue);
                currentCue++;
                notifyAll();
            catch(Exception a){}
        synchronized void doTaskThree(){
            try{
                while(currentCue != myCueState)
                    wait();          
                //Do your task now
                System.out.println("doTaskThree got Executed: "+currentCue);
                currentCue++; 
                notifyAll();
            catch(Exception a){}
        synchronized Object getSomething(){
            try{                   
                while(currentCue != myCueState)
                    wait();           
                //Do your task now
                System.out.println("getSomething got Executed");
                currentCue++;
                notifyAll();
            catch(Exception a){}
            return "something";
        //Access the buffer class through a single static synchronized instance and draw a turn number
        public synchronized Buffer instance(){
            myInstance = new Buffer();
            myInstance.setMyCueState();
            return myInstance;
        private void setMyCueState(){
             myCueState = lastCued;
             lastCued++;
    }and here for the Test class I have coded to test this:
    public class TestBuffer{
         private Buffer accessOne;
         private Buffer accessTwo;
         private Buffer accessThree;
         private Buffer accessFour;
         public TestBuffer(){
                    //Instantiate different instances from Bufferclass and draw a number
              accessThree = new Buffer().instance();
              accessOne = new Buffer().instance();
              accessTwo = new Buffer().instance();          
              accessFour = new Buffer().instance();
              Thread one = new Thread(){
                   public void run(){
                        accessOne.doTaskOne();
              Thread two = new Thread(){
                   public void run(){
                        accessTwo.doTaskTwo();
              Thread three = new Thread(){
                   public void run(){
                        accessThree.doTaskThree();
              Thread four = new Thread(){
                   public void run(){
                        accessFour.getSomething();
              try{               
                   one.start();                    
                   two.start();
                   three.start();     
                   four.start();                         
              catch(Exception f){}
         public static void main(String args[]){
              TestBuffer myTest = new TestBuffer();
    }What am I doing wrong here??
    Maby this is not how I should use the notifyAll() method, but how then?
    Please give me a solution!
    Thanks

    Ok, so if I get you guys right, the following should do it:
    public class Buffer{
        private static Object sharedLock = new Object();
        public void doTaskOne(){      
              synchronized(sharedLock)  {
                System.out.println("doTaskOne got Executed: ");
        public void doTaskTwo(){
             synchronized(sharedLock)  {
                System.out.println("doTaskTwo got Executed: ");
        public void doTaskThree(){
             synchronized(sharedLock)  {
                  System.out.println("doTaskThree got Executed: ");
        public Object getSomething(){
            synchronized(sharedLock)  {
                System.out.println("getSomething got Executed");
                return "something";
    }Lets say that each method accesses the same ressources (in this case a table model) to retreave values, delete rows and set some existing values vith new values and all this 20-30 times a minute, all processing will stay synchronised and collision is not possible?
    And lets say I would update the Table model directly from the buffer Class using MyTableModel.instance().setValueAt() or watever methods I implemented on my Table model, could I safely do that using "SwingUtilities.invokeLater();" from my BufferClass just like this:
    public void doTaskThree(){
            synchronized(sharedLock)  {
                   Runnable runme = new Runnable(){
                         public void run(){
                                MyTableModel.instance().setValueAt("abc", 5,5);  
                   SwingUtilities.invokeLater(runme);
    }Thanks in advance for your help guys!

Maybe you are looking for

  • 10.6.8 update running slow as sh*t

    Just did the netupdate to my iMac (running OSX 10.6.8) and now my MAC is running slow as sh*t... is anyone else having this issue? I checked the process level and nothing seems to be over consuming system resources... my question is this... has anyon

  • Sibelius 7.5 can't find "sounds library", I reinstalled and upgraded but no success. Any ideas. I'm on imac oxa 10.9.4.

    Sibelius 7.5 can't find "sounds library", I reinstalled and upgraded as Sibelius online help suggested but to no avail. Anyone have any ideas? My display speakers do work. Thanks, Jccnwmac

  • How do I stop Safari's content from wobbling?

    In Lion, there is this insipid wobbling of the page's view (programmer terms, I know) when the page has no scroll bars (scrolling set to always on) and you use the magic mouse's center point to finger scroll up. The "view" scrolls away from the top l

  • Microsoft SQL 2005 preload problem

    Hi Guys, First post! I took receipt of my W520 a few weeks ago. It is great, very pleased with it on the whole. There is one problem, however. I play a fair amount of recreational card games over the internet. This requires a program which converts t

  • Firefox not closing the first two tabs... Is there a solution ?

    Since this morning I'm not able to quit the first two tabs in firefox... It close the page but display an empty tab instead. Here's a screenshot : http://i.imgur.com/yGAP7Hn.gif Anyone experiencing the same issue ? Is there any solutions (in about:co