dev@glassfish.java.net

Re: asadmin create-jvm-options usage?

From: Jane Young <Jane.Young_at_Sun.COM>
Date: Wed, 14 Feb 2007 15:08:14 -0800

Want to make one clarification about the manpage example.
The example is correct with the operand:

\\-Dunixlocation=/root/example:-Dvariable=\$HOME:-Dwindowslocation=d\\:\\\sun\\\appserver:-Doption1=-value1

The reason why you need to escape "-Dunix..." is so that asadmin will
not parse it as an option.

An alternative way is to use "--" to separate the options and operand.

HTH,
Jane



Jonathan Benoit wrote:

> I can't use Admin Console in my case, as this needs to be done via ant
> task for automation purposes.
>
> Only when it didn't work within my ant task, then i tried outside of
> ant's build.xml at the asadmin> prompt, and encountered errors as
> described.
>
> Tom Amiro wrote:
>
>> Jon,
>>
>> What about using the Admin Console. It has a UI for adding jvm options.
>> Just browse localhost:4848 and look around.
>>
>> Tom
>>
>> Jonathan Benoit wrote:
>>
>>> kedar wrote:
>>>
>>>> Use
>>>>
>>>>> create-jvm-options --passwordfile adminpassword.txt --user admin
>>>>> -- terse=true --host localhost --echo=true --port 4849 -- -
>>>>> Demma.rt.control.port=47650
>>>>
>>>
>>>
>>> I didn't see this format documented in the help, but it didn't work
>>> either.
>>>
>>> asadmin> create-jvm-options --passwordfile adminpassword.txt --user
>>> admin --terse=true --host localhost --echo=true --port 4849 --
>>> -Demma.rt.control.port=47650
>>> CLI147 Invalid command, emma.rt.control.port=47650
>>> Use "help" command for a list of valid commands.
>>>
>>> fyi, my adminpassword.txt contains:
>>> AS_ADMIN_PASSWORD=adminadmin
>>> AS_ADMIN_ADMINPASSWORD=adminadmin
>>> AS_ADMIN_MASTERPASSWORD=changeit
>>>
>>>> I know this is a bit clumsy.
>>>>
>>>> We should improve the usage if the above works.
>>>> Kedar
>>>>
>>>> On Feb 14, 2007, at 1:26 PM, Jonathan Benoit wrote:
>>>>
>>>>> I'm trying to use asadmin create-jvm-options to add equivalent of
>>>>> VM option -Demma.rt.control.port=47651 into domain.xml.
>>>>>
>>>>> I do this:
>>>>>
>>>>> asadmin> create-jvm-options --passwordfile adminpassword.txt
>>>>> --user admin --terse=true --host localhost --echo=true --port
>>>>> 4849 \- Demma.rt.control.port=47650
>>>>> CLI147 Invalid command, mma.rt.control.port=47650
>>>>> Use "help" command for a list of valid commands.
>>>>>
>>>>> why this error?
>>>>>
>>>>> The example from help shows:
>>>>>
>>>>> EXAMPLES
>>>>> Example 1: Using the create-jvm-options command
>>>>>
>>>>> JVM options must start with a dash (-). Use the backslash
>>>>> (\) to escape the dash delimiter.
>>>>>
>>>>> asadmin> create-jvm-options --interactive=true --secure=true
>>>>> Press enter to continue, q to quit:
>>>>>
>>>>> --passwordfile passwords.txt --terse=false --user admin
>>>>> --host localhost --port 4849 --target server
>>>>> \\-Dunixlocation=/root/example:-Dvariable=
>>>>>
>>>>> \$HOME:-Dwindowslocation=d\\:\\\sun\\\appserver:-Doption1=-value1
>>>>> Command create-jvm-options executed successfully
>>>>>
>>>>> Usage shows:
>>>>>
>>>>> asadmin> create-jvm-options
>>>>> Usage: create-jvm-options [--terse=false] [--echo=false] [--
>>>>> interactive=true] [--host localhost] [--port 4848|4849] [--secure
>>>>> | -s] [--user admin_user] [--passwordfile file_name] [--
>>>>> profiler=false] [--target target(Default server)] (jvm_option_name
>>>>> [=jvm_option_value])[:jvm_option_name[=jvm_option_value]]*
>>>>> CLI020 Operand is required.
>>>>>
>>>>> What do I have to do to successfully create a VM arg in
>>>>> domain.xml using asadmin create-jvm-options?
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>