Re: WOApp executable args

From: Lachlan Deck (lachlan.dec..mail.com)
Date: Fri Apr 17 2009 - 18:44:27 EDT

  • Next message: Henrique Prange (JIRA): "[OS-JIRA] Created: (WOL-999) Remove the deprecated maven-archetype-woapplication from build"

    On 17/04/2009, at 9:42 PM, Mike Schrag wrote:

    > What exactly are you referring to?

    I'm referring to the app executable shell script:
    MyApp.woa/MyApp[.cmd]

    > I thought for a minute you meant inside WOLips,

    No.

    > but then you mention the ant tasks ... Are you talking about the
    > WOApplication jvmOptions flag?

    No.

    I'm talking about the shell script that parses the additional
    arguments from java monitor and/or command-line when starting up the
    app. i.e., it determines what goes into the JAVA_EXECUTABLE_ARGS
    variable.

    So the last line of the script, for example, has something like:
    eval exec ${JAVA_EXECUTABLE} ${JAVA_EXECUTABLE_ARGS} -classpath
    WOBootstrap.jar com.webobjects._bootstrap.WOBootstrap $
    {COMMAND_LINE_ARGS} -WOFrameworksBaseURL /WebObjects/MyApp.woa/
    Contents/Frameworks

    The for loop that's above this line parses the arguments. I'm
    proposing adjusting that for loop as the below patch suggests
    (assuming that it's the woproject-ant-tasks that's used in producing
    the file)

    $ svn diff --force woproject/woproject-ant-tasks/src/resources/woapp/
    Contents/MacOS/appstart
    Index: woproject/woproject-ant-tasks/src/resources/woapp/Contents/
    MacOS/appstart
    ===================================================================
    --- woproject/woproject-ant-tasks/src/resources/woapp/Contents/MacOS/
    appstart (revision 5713)
    +++ woproject/woproject-ant-tasks/src/resources/woapp/Contents/MacOS/
    appstart (working copy)
    ..-309,6 +309,9 @@
              -X*) # This only belongs in the JVM arg list, doesn't
    need quotes.
                        JAVA_EXECUTABLE_ARGS="${JAVA_EXECUTABLE_ARGS:+
    $JAVA_EXECUTABLE_ARGS }${arg}"
                        ;;
    + ---*) # Standard Java options (e.g., -yjpagent:foo) need
    some form of escaping. These only belongs in the JVM arg list, doesn't
    need quotes.
    + JAVA_EXECUTABLE_ARGS="${JAVA_EXECUTABLE_ARGS:+
    $JAVA_EXECUTABLE_ARGS }"`echo "${arg}" | sed -e "s/^---\(.*\)$/-\1/"`
    + ;;
              [\"]*[\"] | [\']*[\'])
                        # These args are already quoted.
                        COMMAND_LINE_ARGS="${COMMAND_LINE_ARGS:+
    $COMMAND_LINE_ARGS }${arg}"

    > On Apr 17, 2009, at 2:46 AM, Lachlan Deck wrote:
    >
    >> Hi all,
    >>
    >> I've found that when attempting to add something like -agentlib:foo
    >> to the additional args in JavaMonitor that it's treated like a
    >> standard java property when the app's executed which ain't good.
    >>
    >> So unless there's some means of escaping this already(?) I propose
    >> adding a means of escaping java executable args that don't fit the
    >> current scheme (i.e., aren't like -X, -XX etc which are currently
    >> treated as jvm args just fine).
    >>
    >> I can add an additional option to the executable that would allow
    >> you to define an option like -JVMagentlib:foo or --agentlib:foo
    >> instead and massage it appropriate for the actual args.
    >>
    >> i.e., any args matching -JVM* (or alternatively matching --*)
    >>
    >> Thoughts?
    >>
    >> Just to double check also that the following resource is what's
    >> currently used when building the bundle?
    >> woproject-ant-tasks/src/reources/woapp/Contents/MacOS/appstart

    with regards,

    --
    

    Lachlan Deck



    This archive was generated by hypermail 2.0.0 : Fri Apr 17 2009 - 18:45:57 EDT