Bonjour,
J'ai utilisé Runtime.getRuntime().exit(0); et aussi System.exit(0); mais le process java ne s'arrête pas.
Il ya til d'autres suggestions?
merci d'avance
Version imprimable
Bonjour,
J'ai utilisé Runtime.getRuntime().exit(0); et aussi System.exit(0); mais le process java ne s'arrête pas.
Il ya til d'autres suggestions?
merci d'avance
il devrais sortir lors de cette appel, immédiatement. Tu n'aurais pas, dans ton application, un ShutdownHook enregistré qui bloquerais? Je vois pas ce qui d'autre pourrait empêcher System.exit de fonctionner.
PS: t'es sur de bien avoir fait cet appel?
non il n'ya pas un hook à executer.
NB: j'utilise HP com OS et je lance le programme java à travers un script perl
Il ya pa une autre commande qui cout cout ferme les process parent et fils?
la première chose à faire est de t'assurer que le programme passe bien sur ton appel, en mettant un System.out.println avec un message tout juste avant. L'OS n'y est pour rien, j'utilise HP-UX depuis des années, je t'assure que la jvm quitte bien quand on fait un System.exit()
Ca veut dire quoi exactement ?Citation:
mais le process java ne s'arrête pas.
Si tu fais un System.err.println("xxx") après l'appel à System.exit(0), le message s'écrit sur la console ???
Si le message s'affiche, c'est incroyable :aie:
Si le message ne s'affiche pas, le problème est peut-être ailleurs.
T'es sûr que le process java que tu vois est le bon ? CAD, celui qui a été stoppé par System.exit(0).
Tu n'aurais pas un autre programme Java lancé à côté (donc un autre processus et une autre instance de jvm non terminée par System.exit(0)) ?
si je fais un kill -3 sur le process en cours je trouve :
"RMI TCP Accept-0" daemon prio=10 tid=0068b008 nid=20 lwp_id=4950421 runnable [70240000..70240738]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
- locked <748f2738> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:456)
at java.net.ServerSocket.accept(ServerSocket.java:427)
at sun.rmi.transport.tcp.TCPTransport.run(TCPTransport.java:340)
at java.lang.Thread.run(Thread.java:595)
"DestroyJavaVM" prio=10 tid=00093168 nid=1 lwp_id=4950377 waiting on condition [00000000..7f634398]
"SyntheticaCleanerThread" daemon prio=8 tid=0068ae58 nid=18 lwp_id=4950407 waiting on condition [6fb40000..6fb40638]
at java.lang.Thread.sleep(Native Method)
at de.javasoft.plaf.synthetica.StyleFactory$ComponentPropertyStore$1.run(StyleFactory.java:1333)
"AWT-EventQueue-0" prio=10 tid=000943f8 nid=17 lwp_id=4950403 waiting for monitor entry [6fc00000..6fc006b8]
at com.alu.cnm.csa.sso.lsm.LsmCorbaRequestThread.a(LsmCorbaRequestThread.java:124)
- waiting to lock <749f8170> (a java.util.Stack)
at com.alu.cnm.csa.sso.lsm.LsmCorbaManager.do(LsmCorbaManager.java:512)
at com.alu.cnm.csa.sso.lsm.LsmBrowserHandler.browserControlGained(LsmBrowserHandler.java:205)
- locked <74b54bf0> (a com.alu.cnm.csa.sso.util.SyncObject)
at com.alcatel.almap.amv.fwk.integration.i.a(AmvDifPanel.java:941)
- locked <74ab5810> (a com.alcatel.almap.amv.fwk.integration.i)
at com.alcatel.almap.amv.fwk.integration.NavigMgr.a(NavigMgr.java:308)
at com.alcatel.almap.amv.fwk.integration.NavigMgr.a(NavigMgr.java:148)
at com.alcatel.almap.amv.fwk.integration.ClientProxy.startNavigation(ClientProxy.java:725)
at com.alcatel.almap.amv.fwk.integration.ClientProxy.startNavigation(ClientProxy.java:691)
at com.alu.cnm.csa.sso.lsm.LsmClientApp.onTaskSelection(LsmClientApp.java:152)
at com.alcatel.almap.amv.fwk.integration.AbstractClientManager.if(AbstractClientManager.java:431)
at com.alcatel.almap.amv.fwk.integration.AmvRuntimeClientManager.a(AmvRuntimeClientManager.java:261)
at com.alcatel.almap.amv.fwk.integration.FwkMain.run(FwkMain.java:98)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
"AWT-Motif" daemon prio=10 tid=00094248 nid=16 lwp_id=4950402 runnable [6fcc0000..6fcc0538]
at sun.awt.motif.MToolkit.run(Native Method)
at java.lang.Thread.run(Thread.java:595)
"AWT-Shutdown" prio=10 tid=00094098 nid=15 lwp_id=4950401 in Object.wait() [6fd80000..6fd805b8]
at java.lang.Object.wait(Native Method)
- waiting on <74875678> (a java.lang.Object)
at java.lang.Object.wait(Object.java:474)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
- locked <74875678> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:595)
"Java2D Disposer" daemon prio=10 tid=00093ee8 nid=14 lwp_id=4950400 in Object.wait() [6fe40000..6fe40838]
at java.lang.Object.wait(Native Method)
- waiting on <74875700> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:137)
- locked <74875700> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:153)
at sun.java2d.Disposer.run(Disposer.java:125)
at java.lang.Thread.run(Thread.java:595)
"UpdateThread" prio=8 tid=00093d38 nid=13 lwp_id=4950398 waiting on condition [70040000..700408b8]
at java.lang.Thread.sleep(Native Method)
at com.alcatel.almap.fwk.comet.basiccomp.JUpdateThread.run(JUpdateThread.java:72)
"Low Memory Detector" daemon prio=10 tid=000939d8 nid=11 lwp_id=4950387 runnable [00000000..ffffffff]
"CompilerThread1" daemon prio=10 tid=0026e300 nid=9 lwp_id=4950385 waiting on condition [00000000..70101a54]
"CompilerThread0" daemon prio=10 tid=0026e118 nid=8 lwp_id=4950384 waiting on condition [00000000..703018d4]
"AdapterThread" daemon prio=10 tid=0026df30 nid=7 lwp_id=4950383 waiting on condition [00000000..ffffffff]
"Signal Dispatcher" daemon prio=10 tid=00093828 nid=6 lwp_id=4950382 waiting on condition [00000000..ffffffff]
"Finalizer" daemon prio=10 tid=00093678 nid=5 lwp_id=4950381 in Object.wait() [70740000..707408b8]
at java.lang.Object.wait(Native Method)
- waiting on <74816938> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:137)
- locked <74816938> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:153)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:197)
"Reference Handler" daemon prio=10 tid=000934c8 nid=4 lwp_id=4950380 in Object.wait() [77340000..77340738]
at java.lang.Object.wait(Native Method)
- waiting on <74816550> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:123)
- locked <74816550> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=7 tid=001a91a8 nid=3 lwp_id=4950379 runnable
"VM Periodic Task Thread" prio=8 tid=001a9260 nid=10 lwp_id=4950386 waiting on condition
qu'est ce que ca peut être?? :cry: