problem with passing "Event Handler Variable" to an external command as its arqument

  • ElhamNj

    ElhamNj - 2013-10-12

    I want to execute an external jar file when some events occur (such as jvm_stop or jvm_start or wrapper_start and etc). and I need to pass 'event handler variable' to that external command(myJar.jar) as an argument.
    but when an event occurs all of environment variable can be passed to that jar file except these Event Handler Variable!

    here is my wrapper.conf:


    and here is ExternalJar bash file
    java -jar myJar.jar ${WRAPPER_EVENT_NAME}

    every things works properly and main method of myJar.jar will be called, but at the main method of myJar.jar I dont get any argument!
    I tested this with ${HOME} environment variable and that was ok and I get value of ${HOME} in myJar main method.

    can someone help me?

  • Leif Mortenson

    Leif Mortenson - 2013-10-15

    If you want to run an external command, you will need the full command line as follows:


    The first line is to enable log output which will let you see the generated command line. In this case, it looks like this:

    wrapper | Event Command 'wrapper_start': Command line: E:\Sun\jdk1.6.0_24_x64\bin\java -jar myJar.jar wrapper_start
    wrapper | Event Command 'wrapper_start': Command launched (pid: 512), continuing...
    Jar output...
    wrapper | Event Command 'wrapper_start': Command completed with exit code: 1 Continuing.

    This will be the actual command line used to launch Java. If you are having problems in your jar file, please try typing this command directly from the command line to test it without the Wrapper in the equation. It should work the same.


  • ElhamNj

    ElhamNj - 2013-10-18

    dear Alexandre and Mr Mortenson
    Hello, and thank you for your reply, I really appreciated it.
    yes you were right and my problem was solved with your solution.
    thank you in advance.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks