Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: ShutDownListener question

  1. #1
    Member
    Join Date
    Apr 2013
    Posts
    62
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default ShutDownListener question

    hi i wrote a program that forces System.exit(0); but first launches ShutDownListener to run another package java -jar path to file/program2.jar
    and this all works fine however i want to run this programe every 5 hours and am usin cron on ubuntu to do this. but the first programe runs fine and i presume exits as i have all output file from the programe stamped with time and ate so it definitly runs however it doesint launch th second package?? does anyone have any experiance with this an be able to shed some light plan b is to write another schedual for second package but that would be iniffeicent and all soo does anyone kjnow why ShutDownListener might work in netbeans but not from terminal? thaks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,961
    My Mood
    Hungover
    Thanks
    133
    Thanked 553 Times in 474 Posts

    Default Re: ShutDownListener question

    You need to do some troubleshooting. Where exactly is the problem? You've got a few different things happening, so you have to narrow the problem down. Does the first program exit without any Exceptions? Does the ShutDownListener fire? Can you run another process from a normal program instead of a ShutDownListener?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Apr 2013
    Posts
    62
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: ShutDownListener question

    i dont have any ouput as it runs in the background dumps a file on desktop and launches other package. the file is dumped on desktop but then the second package never starts there is no output from programe except the products dumped in files on desktop. when i run in netbeans it all works fine with o probs and second package runs

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,961
    My Mood
    Hungover
    Thanks
    133
    Thanked 553 Times in 474 Posts

    Default Re: ShutDownListener question

    I'm not sure what you want us to do. You haven't posted an SSCCE for us debug, and you say you can't debug it yourself. That's going to make debugging it pretty hard, don't you think?

    If you can't test the whole application, then you need to create an SSCCE that performs a similar action without any overhead. Can you get that to work?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Member
    Join Date
    Apr 2013
    Posts
    62
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: ShutDownListener question

    the problem is with a webdriver not shuting down correcley thinks i have it sorted sorry for lack of details but every [roblem i face is the first time i face it me noob