dev@glassfish.java.net

Re: domain.xml in notepad

From: Arun Gupta <Arun.Gupta_at_Sun.COM>
Date: Wed, 13 Dec 2006 17:43:21 -0800

See in line ...

kedar wrote:
> This is something that I had been
> asking for long. But couldn't convince people.
> Can you file an enhancement request?
Filed: https://glassfish.dev.java.net/issues/show_bug.cgi?id=1747

>
> Also, any reason why you won't use
> "asadmin create-jvm-options"m or the GUI for this?
Yeah, here are my few reasons:

1). The only sample in create-jvm-options is:

-- cut here --
asadmin> create-jvm-options --interactive=true --secure=true
--passwordfile passwords.txt --terse=false --user admin
--host localhost --port 4849 --target server
\\-Dunixlocation=/root/example:-Dvariable=
\$HOME:-Dwindowslocation=d\\:\\\sun\\\appserver:-Doption1=-value1
-- cut here --

I think this is a little too verbose sample. I think it'd be beneficial
to have a really simple sample (using all default options) to go along
with this verbose one.

2). When I gave the command create-jvm-options, I got the following error:

-- cut here --
C:\testbed\glassfish\bin>asadmin.bat create-jvm-options --user=admin
-DWSIT_HOME
=%CATALINA_HOME%
Please enter the admin password>
Unable to connect to admin-server. Please check if the server is up and
running
  and that the host and port provided are correct.
CLI137 Command create-jvm-options failed.
-- cut here --

The error message says "Unable to connect to admin-server" and then it
says "Please check if the server is up and running". Do I check the
domain server or admin server ?

The error message seems slightly incomplete as it does not tell me how
to check whether the server is running or not.

When I specified the default port as "--pot=4848", then it worked. I
wonder why am I required to specify the default port.

3). I know I need to add jvm-options in domain.xml but how do I map it
to the clicks in asadmin console. I think having a search feature in
admin console to enable that would be helpful. I could figure out where
these values need to be specified in console though.

4). I want the following jvm-options to be added:

-DWSIT_HOME=C:\testbed\apache-tomcat-5.5.20

but giving the following command:

-- cut here --
C:\testbed\glassfish\bin>asadmin.bat create-jvm-options --user=admin
--port=4848
  -DWSIT_HOME=C:\testbed\apache-tomcat-5.5.20
-- cut here --

gives the following error:

-- cut here --
Invalid Jvm Option testbedapache-tomcat-5.5.20. Option must start with -.
CLI137 Command create-jvm-options failed.
-- cut here --

It seems like the command requires me to escape the "\" but the help
does not mention that. Moreover the option is indeed starting with "-"
so I'm not sure what the error message is trying to convey.

As a simple user, why should I deal with platform specific intricacies.

5). A "restart required" allows me to stop the server instance but then
asks to start the instance from command line. Since the admin console
has privileges to stop the server, it should be able to restart it as
well and there by simplifying the steps.

All this may look intuitive to users already familiar GlassFish but
certainly not to a new user. For reasons 1)-4), I find it more
convenient to open up domain.xml in an editor, search for jvm-options
and add mine there :)

Thanks,
-Arun

>
> Thanks,
> Kedar
>
> Arun Gupta wrote:
>> domain.xml comes gobbled up in notepad and it's hard to edit. I added
>> a jvm-option using XML Notepad [1] and that messed up the complete
>> file and now I'm getting:
>>
>> -- cut here --
>> com.sun.enterprise.config.ConfigException: Error refreshing
>> ConfigContext:C:\tes
>> tbed\glassfish\domains\domain1\config\domain.xml
>> cause: Failed to create the XML-DOM Document. Check your XML to make
>> sure it is
>> correct.
>> Element type "DOMAIN" must be declared.
>> CLI156 Could not start the domain domain1.
>> -- cut here --
>>
>> I'd rather use notepad provided domain.xml can be displayed
>> XML-formatted. Any reason it's not ?
>>
>> [1] http://www.snapfiles.com/download/dlxmlnotepad.html
>>
>> -Arun
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>

-- 
Web Technologies and Standards
Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta