Вопрос

In attempting to run the following command in a Jacl script (with $APPNAME having been set prior to this call):

$AdminApp install $EARFILE {-nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -nodeployejb -verbose -appname $APPNAME -createMBeansForResources -noreloadEnabled ...}

I get the following error.

WASX7017E: Exception received while running file "deploy_myk.jacl"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7108E: Invalid data specified for install task: "AppDeploymentOptions."  
Errors are: 
"ADMA0085E: A validation error occurred in task Specifying application options. Application name, $APPNAME, is not valid.
 An application name cannot begin with a dot, cannot have leading or trailing spaces, cannot contain "]]>", and cannot contain any of the following characters:  \ / , # $ @ : ; " * ? < > | = + & % '"

I seem unable to find the docs that shed light on the use of script variables within an 'option' specifier string. Clearly there must be some way to do what I'm trying to do, which is deploy an EAR file with a name of my choosing at the time the script is run

Это было полезно?

Решение

Jacl/Tcl is a string-based language, and the {} delimiter prevents variable interpolation, similar to '' in UNIX shell programming. You want something like:

$AdminApp install $EARFILE "-nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -nodeployejb -verbose -appname $APPNAME -createMBeansForResources -noreloadEnabled ..."

...or:

$AdminApp install $EARFILE [list -nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -nodeployejb -verbose -appname $APPNAME -createMBeansForResources -noreloadEnabled ...]

This Tcl tutorial might be of interest, particularly the "Evaluation & Substitutions" section.

Alternatively, you could avoid the complexities of Jacl strings by switching to -lang jython.

Другие советы

The variable you are using must be set before you use it. As you have not included any details about you actually doing that I assume that is what is missing. In your script you should be able to start with something like:

# Set $APPNAME to be the first argument to this script.
set APPNAME [lindex $argv 0]

And then go from there. Then you can run your jacl script with your application name as the first argument.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top