users@glassfish.java.net

Re: Glassfish V3 as a Service on Windows Server

From: NBW <emailnbw_at_gmail.com>
Date: Sat, 13 Feb 2010 23:52:18 -0500

Hi Byron,

Thanks for the detailed response! My comments are inline.

On Sat, Feb 13, 2010 at 5:07 AM, <glassfish_at_javadesktop.org> wrote:

> Actually I think you have a point! It isn't good enough to have just the
> server ignore logouts. The asadmin JVM ALSO needs to ignore logouts.
> Remember if one goes down, it takes the other down with it. I'll bet
> that's the problem.
>
> Work-around -->
>
> in <<domain-dir>>/bin edit the <domainname>Service.xml file and add "-Xrs"
> as a parameter (it will be obvious how to do that).
>
>
So in looking at the file it was not obvious to me where/how to add the JVM
parameter and here's why. The file points the service wrapper at asadmin.bat
and there's a bunch of startup parameters which get passed along to the bat
file. The business in asadmin.bat gets done with the following:

%JAVA% -jar "%~dp0..\glassfish\modules\admin-cli.jar" %*

Now, I'm no BAT file ninja and I haven't looked at the source to the service
wrapper, but I am guessing that all the <startarguements> in
domain1Service.xml are going to be passed into %*. So if I were to add -Xrs
as a <startarguement> it would end up at the tail of that java command. The
man page for the java command specifies that options, -X args included, need
to preceed the -jar arg. With that in mind it wasn't obvious how I could
modify that XML file to have -Xrs passed in as needed.

So, what I did do is add it to the asadmin.bat file like so:

 %JAVA% -Xrs -jar "%~dp0..\glassfish\modules\admin-cli.jar" %*

This did the trick, however, I don't really like it because it will affect
not only the service's use of the bat file but everyones use of the bat file
but at least it proved the theory.

On a related note, you mentioned that winsw is on Kenai - since Oracle has
announced that Kenai is going away (at least to the general public) will
this project be moved elsewhere that will continue to be publicly available?

Also, you mentioned that v3 uses -verbose and v2 does not (when run as a
service). v2 has the --versbose option available. Does it behave the same
way as you described it in v3?

Lastly, what role does the ProcessLauncher play in all this. There's the
processLauncher.xml file whose comments indicate that <sysproperty>'s can
contain non-settable JVM options as it indicates too that settable ones are
to come from domain.xml. This would imply that the options in
processLauncher.xml are combined with the JVM options in domain.xml and used
by the ProcessLauncher to launch the server JVM. If that is the case then
what isn't clear to me is why there are reports that to solve the -Xrs
problem under v2, on some platforms (server 2003 I think) it only worked if
they added -Xrs to both the domain.xml and the processLauncher.xml.

Thanks again, your feedback has been very helpful!

-NBW