IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Stop Java process


Sujet :

Java

  1. #1
    Nouveau membre du Club
    Inscrit en
    Novembre 2008
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 6
    Par défaut Stop Java process
    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

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    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?

  3. #3
    Nouveau membre du Club
    Inscrit en
    Novembre 2008
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 6
    Par défaut
    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?

  4. #4
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    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()

  5. #5
    Membre chevronné
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    476
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2003
    Messages : 476
    Par défaut
    mais le process java ne s'arrête pas.
    Ca veut dire quoi exactement ?
    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

    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)) ?

  6. #6
    Nouveau membre du Club
    Inscrit en
    Novembre 2008
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2008
    Messages : 6
    Par défaut
    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??

  7. #7
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par kokomelle Voir le message

    qu'est ce que ca peut être??
    Le plus probablement, tu n'a pas appelé System.exit.

Discussions similaires

  1. Obtenir le PID du process java
    Par manutudescends dans le forum Langage
    Réponses: 3
    Dernier message: 19/08/2006, 18h25
  2. [Java 1.5] Process : afficher le flux de sortie
    Par Zapan dans le forum API standards et tierces
    Réponses: 2
    Dernier message: 11/01/2006, 10h34
  3. [Système][Process] Scripts shell à partir d'une appli java
    Par mickbzh dans le forum API standards et tierces
    Réponses: 3
    Dernier message: 22/07/2005, 15h40
  4. [Process]renvoyez un zcat en argument pour un prog java
    Par jdeboer dans le forum Eclipse Java
    Réponses: 5
    Dernier message: 01/07/2005, 15h48
  5. [Process] Probleme d'execution d'un prog c dans un prog java
    Par Elmilouse dans le forum API standards et tierces
    Réponses: 2
    Dernier message: 08/06/2004, 14h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo