exit code always 0 without l4j-debug
Brought to you by:
grzegok
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
it's console application.
www.liquibase.org
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
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.
I provided wrong database credentials to generate error. So I am expecting non zero exit code for both cases.
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
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.