Menu

#138 exit code always 0 without l4j-debug

3.x
open
nobody
exit code (1)
3
2016-11-15
2015-02-09
sergey
No

I use java application Liquibase. If I use it "as per normal" - exit code is always 0 even I provide wrong parameters to generate error. But if I add key --l4j-debug, exit code is correct : -1. If I call liquibase without wrapper, the values are 0 -when all parameters valid and -1 when liquibase generates error.

OS : Windows 8 64bit and Windows 2008 32bit

Discussion

  • sergey

    sergey - 2015-02-09

    it's console application.

    www.liquibase.org

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-04-24

    I can't reproduce this, and --l4j-debug doesn't seem to influence the way the exit code is handled. Can you post more details? For example the launch4j.log ?

    Grzegorz

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-04-24
    • status: open --> pending
     
  • sergey

    sergey - 2015-04-27

    This is batch file I am using as a test case :test2.bat

    I am calling the same exe file without and with l4j-debug parameter. All other parameters are the same (I just copied them from first line)

    This is an output: test2.out

    launch4j.log attached as well.

     
  • sergey

    sergey - 2015-04-27

    I provided wrong database credentials to generate error. So I am expecting non zero exit code for both cases.

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-05-09

    Thanks for the details,

    First of all you were not using the latest version but 3.4. There were some changes and fixes regarding the exit code since then. So please check with the latest version 3.7.

    But still, there is another problem. In your case launch4j was not able to start the process. You can see this by the message 'An error occurred while starting the application' in test2.out. I was only able to reproduce this by replacing java.exe with a dll file.

    Was it possible to run the wrapped liquibase, when the parameters were correct?
    Can you run these test again with the 3.7 version and attach the files again?

    Might be I'll have to check liquibase, maybe there is some strange way it exits.

    Grzegorz

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-05-09
    • status: pending --> open
     
  • Neumi

    Neumi - 2016-11-15

    In version 3.9 I am only able to get the error codes from my application if I set header type to "console". If I use "gui" "jni console" or "jni gui", then the error code is always 0. Calling the jar directly using java.exe or javaw.exe (to test the gui functionality) returns the correct error codes.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.