Manually configuring domain.xml using ${name} and -Dname
I need to be able to use this syntax:
<jms-service addresslist-behavior="random" addresslist-iterations="3" init-timeout-in-seconds="60" reconnect-attempts="3" reconnect-enabled="true" reconnect-interval-in-seconds="60" type="LOCAL">
<jms-host admin-password="admin" admin-user-name="admin" host="${com.memento.localhost}" name="default_JMS_host" port="7676"/>
</jms-service>
When I add -Dcom.memento.localhost="%COMPUTERNAME%" to the script that runs CLIMain, the property is not replaced when the above jms-service element is processed. I know because the server.log shows:
#|2005-03-16T17:00:39.809-0500|INFO|sun-appserver-pe8.1|javax.enterprise.system.stream.out|_ThreadID=10;|
URL is :mq://${com.memento.localhost}:7676/,
Where do I set my property so it is picked up for replacement in domain.xml? Apparently the Java command that runs CLIMain is not the right place. Or soemthing else is wrong?
[1320 byte] By [
42.57.42] at [2007-11-13]

If I understand this correctly, you need to do a token replacement so that the runtime accepts the configured value.
<P>
What you need is a "system-property".
Here is how I would go about doing it:
<ul>
<li> No need to modify the asadmin script at all. </li>
<li> ./asadmin set --user admin --passwordfile /tmp/pass "server.jms-service.host=${${com.memento.localhost}"</li>
<li> This will add this value as expected in domain.xml. </li>
<li> But this is not what you want. </li>
<li> You need something called as a "system property" that is specific to SJS application server. <li>
<li> This is a convenient way of creating a token and replace it at runtime. </li>
<li> Either in the admin GUI or admin CLI, you need to define a system property. For example, the system property in the above case could be defined on CLI as: ./asadmin create-system.properties --user admin --passwordfile /tmp/pass "com.memento.localhost=the-actual-machine-name"
</li>
Hope this helps.
</ul>
This is odd. ASADMIN says it knows the create-system-properties command when I say
ASADMIN HELP CREATE-SYSTEM-PROPERTIES
When I try to use it, it complains:
C:\project> asadmin create-system-properties --user admin -passwordfile pw.txt "memento.localhost=FAWKES"
CLI001 Invalid Command, create-system-properties. Use "asadmin help" for a list of valid commands.
I have fairly carefuly examined the contents of the admin-cli.jar and find that while there is a help file for the command create-system-properties in it, there is no command descriptor for the command.
So, what are my other options? Can I hack whatever file would have been modified by this missing command?
create-system-properties is a valid command with SJS AS 8.1 onwards . If you are using 8.0, it's not possible to use -Dname JVM option for setting JMS host .Regards,Manisha.
I have 8.1 2005Q1 and it also does not recognize create-system-properties. It also throws the same invalid command error for list-system-properties.
asadmin --help will, however, show both of those commands as being supported.
How many other commands don't work? Is there a bug on this?
Dave
Hi
I am using Sun Java Application Server 8.1 2005 Q2 .....
There is a file called domain.xml in <server_install_dir>/domain/domain1/config directory....
In that i have a line,
<access-log format="%client.name% %auth-user-name% %datetime% %request% %status% %response.length%" rotation-enabled="true" rotation-interval-in-minutes="1440" rotation-policy="time" rotation-suffix="%YYYY;%MM;%DD;-%hh;h%mm;m%ss;s" />
I changed it to
<access-log format="%client.name% %auth-user-name% %datetime% %request% %status% %response.length% %cookie.value%" rotation-enabled="true" rotation-interval-in-minutes="1440" rotation-policy="time" rotation-suffix="%YYYY;%MM;%DD;-%hh;h%mm;m%ss;s" />
I did this after reading the sun docs in this link...
http://docs.sun.com/source/819-0076/httpservice.html
I did this and restarted my server....but still there is no change in my log format....i dont know wat is my mistake.....
Please guide me.....
hi Guys,
create-system-properties, delete-system-properties, list-system-properties commands are available and executable in Standard Edition and Enterprise Edition.
The reason you are seeing the error is because you installed Platform Edition. The help pages include all commands that are in both PE and SE/EE versions.
Personally, i think they should not combine it in one place. Either keep it separate or change the error message that it doesnt exist in PE version.
What do you guys think ?
hi nishmi_balan,did you look for the log in <install>/domains/domain1/logs/access directory?
hi 42.57.42,since create-system-properties will not work in PE, could you use sed command to replace value ?
I did end up resorting to editing the files. (I was using it on Windows as parto fthe install of our product, so I rolled a replacement for sed.)