Skip to main content

Node Agent Windows Service

11 replies [Last post]
areplogle
Offline
Joined: 2007-02-07

Hello,

I've used the instructions on the GFWiki to create the windows service for the glassfish domain but that tool only does the domain. I've tried using SC.exe several times to add the nodeagents on the various physical servers but I can never seem to get the syntax correct.

Can anyone help give me an example where I could just change the paths if they vary? Or am I going about this the wrong way, is there some way to set the domain instance to start the nodeagents when it comes up?

Any help or direction is greatly appreciated =]

TIA,

Andrew

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
areplogle
Offline
Joined: 2007-02-07

Another note, I tried this this morning on the 28th. So apparently its not accessing appservService to the point where its even logging. The messages are only from the 27th from when I was using the asadmin.bat command manually.

Andrew

areplogle
Offline
Joined: 2007-02-07

Is there anyone that could assist me with this? If you have any experience setting up glassfish2 as windows services with both the nodeagent / domain, I just would like a little guidance.

We're a software vendor and I've been trying to get Glassfish accepted for our product since before the 2.x release and now I've got enough support internally to get approval for certifying glassfish as a platform for our product.

Unfortunately I'm getting hung up on little things like keeping glassfish running without logging out (hence the need for a windows service). Currently we only support windows server platforms (something I'm also hoping to change) and I really need to be able to run these as a service.

If I tell management that we have to stay logged into the servers in order to keep glassfish running, it'll just be dismissed as an unsupported platform.

Currently, via the GlassfishSVC.jar the domain is working wonderfully as a service, but as stated above, I can't get the NodeAgent service to start that I created.

Does Sun have any type of Partner Contract for Java product vendors trying to certify on their platforms or should I just keep trying here?

Any assistance would be greatly appreciated.

TIA - Andrew

John Clingan

On Mar 4, 2008, at 9:40 AM, glassfish@javadesktop.org wrote:

> Is there anyone that could assist me with this? If you have any
> experience setting up glassfish2 as windows services with both the
> nodeagent / domain, I just would like a little guidance.
>
Also, documentation is available on docs.sun.com:
http://docs.sun.com/app/docs/coll/1343.4

The install guide mentions:
"To create a Windows service, the sc.exe utility must be available on
the system. Windows 2000 users may need to install the Windows 2000
Resource Kit to get this utility. For other supported Windows
versions, the utility is included in the operating system."

> We're a software vendor and I've been trying to get Glassfish
> accepted for our product since before the 2.x release and now I've
> got enough support internally to get approval for certifying
> glassfish as a platform for our product.

> Unfortunately I'm getting hung up on little things like keeping
> glassfish running without logging out (hence the need for a windows
> service). Currently we only support windows server platforms
> (something I'm also hoping to change) and I really need to be able
> to run these as a service.
>
> If I tell management that we have to stay logged into the servers in
> order to keep glassfish running, it'll just be dismissed as an
> unsupported platform.
>
> Currently, via the GlassfishSVC.jar the domain is working
> wonderfully as a service, but as stated above, I can't get the
> NodeAgent service to start that I created.
>
> Does Sun have any type of Partner Contract for Java product vendors
> trying to certify on their platforms or should I just keep trying
> here?
>
Can you contact me directly at John dot Clingan at Sun dot COM?

John Clingan
GlassFish Product Manager.

>
> Any

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

areplogle
Offline
Joined: 2007-02-07

Hi John, Thanks for replying.

I just wanted to double-check and see if you received my email. I sent it out the afternoon of the 4th.

Thanks Much,

Andrew

hyau
Offline
Joined: 2005-03-29
hyau
Offline
Joined: 2005-03-29

Please try this document.
http://docs.sun.com/app/docs/doc/819-3671/ablwz?a=view

For example, to create a service called SunJavaSystemAppServer DOMAIN1 that starts and stops the domain domain1, using a password file C:\Sun\AppServer\password.txt:

C:\windows\system32\sc.exe create domain1 binPath=
"C:\Sun\AppServer\lib\appservService.exe \"C:\Sun\AppServer\bin\asadmin.bat
start-domain --user admin --passwordfile C:\Sun\AppServer\password.txt domain1\"
\"C:\Sun\AppServer\bin\asadmin.bat stop-domain domain1\"" start= auto
DisplayName= "SunJavaSystemAppServer DOMAIN1"

To create a service that starts and stops the node agent agent1:

C:\windows\system32\sc.exe create agent1 binPath=
"C:\Sun\AppServer\lib\appservAgentService.exe \"C:\Sun\AppServer\bin\asadmin.bat
start-node-agent --user admin --passwordfile C:\Sun\AppServer\password.txt agent1\"
\"C:\Sun\AppServer\bin\asadmin.bat stop-node-agent agent1\"" start= auto
DisplayName= "SunJavaSystemAppServer AGENT1"

Thanks,
hyau

areplogle
Offline
Joined: 2007-02-07

Here is my exact syntax for creating the service, corrected per the link to documentation you sent:

sc.exe create GF2node binPath= "C:\glassfish\lib\appservAgentService.exe \"C:\glassfish\bin\asadmin.bat start-node-agent --user admin --passwordfile C:\glassfish\password.txt node01\" \"C:\glassfish\bin\asadmin.bat stop-node-agent node01\"" start= auto DisplayName= "GF2 Nodeagent"

This creates the service just fine, like above. But again, the service doesn't start, and windows displays the same 1053 message that it took to long. There's nothing in the nodeagent logs and the Event Log displays the same message as I've posted above.

This is on Windows 2003 Server.

Have you actually tried creating a service for a nodeagent on a windows server and did it work for you?

areplogle
Offline
Joined: 2007-02-07

The initial issue of creating the service is overcome only to be faced with the service not working. Does anyone have a manually created node-agent windows service working?

areplogle
Offline
Joined: 2007-02-07

Just thought I'd bump this and see if anyone could point me in the right direction for how to create a windows service for the node agents? Any thoughts or direction is greatly appreciated.

TIA

Andrew

km
Offline
Joined: 2005-10-28

Might this help?

http://wiki.glassfish.java.net/Wiki.jsp?page=FaqRunAsWindowsService

Just make sure that you use "asadmin start/stop-node-agent" for the purpose of starting/stopping
the node-agent.

Regards,
Kedar

areplogle
Offline
Joined: 2007-02-07

so using the wiki and through trial and error I was able to create a service for the node-agent with:

sc.exe create GF2node binPath= "C:\glassfish\lib\appservService.exe \"C:\glassfish\bin\asadmin.bat start-node-agent --user admin --passwordfile C:\glassfish\password.txt node01\" \"C:\glassfish\bin\asadmin.bat stop-node-agent node01\"" start= auto DisplayName= "GF2 Nodeagent"

The key was recognizing that if I didn't put a space between binPath= and the value "C:\...." it wouldn't create the service.

Now that I have the service created I made sure I have the Xrs option in both the domain.xml and the process xml but when I go to start it I get:

"Could not start the GF2 Nodeagent service on Local Computer."
"Error 1053: The service did not respond to the start or control request in a timely fashion."

in a dialog box. The service then stays hung in a "starting" status and the java.exe spawned from that service just hangs until killed through the task manager.

I've checked the Event Log for any helpful info and saw:

The description for Event ID ( 0 ) in Source ( appservService ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: C:\glassfish\bin\asadmin.bat start-node-agent --user admin --passwordfile C:\glassfish\password.txt node01.

Is this because I'm remote desktopped into the server?

Attached is my nodeagent server.log