Renz Carlo B Mangilit
Renz Carlo B Mangilit

Reputation: 21

Glassfish create-service for [domain 2]

I'm trying to create windows service for glassfish and I've had no problems creating one for the default domain, but when it comes to a domain I created my self, I seem to struggle.

the command I'm using is:

asadmin>create-service --domaindir C:\Program Files\glassfish-4.1.1\glassfish\domains\testdomain

I only get a filenotfound exception. I don't seem to understand glassfish's directory for its domains

aside from this, one of my other problems in the service I created for the default domain is that everytime I try to start it, it just stops immediately

The domain1 GlassFish Server on Local Computer started and then stopped. Some services stop automatically...

it gives me that kind of popup

Upvotes: 2

Views: 3021

Answers (1)

Mike
Mike

Reputation: 4963

The --domaindir option should point to the directory where all your domain directories are located, not the actual domain directory itself.

You also need to specify the name of the domain you want to create a service with.

In practice, this means you simply need to replace the final backslash in the command above with a space, like so:

asadmin> create-service --domaindir C:\Program Files\glassfish-4.1.1\glassfish\domains testdomain

It's a slightly confusingly named option (--domainsdir may have been a better name), but it effectively gives you the option of storing all of your user configuration away from the GlassFish binaries.

The path you've supplied in your example is actually the default directory, so doesn't need to be specified, you should just be able to name the domain you want to create a service from and GlassFish will automatically look in that directory to check if a domain is there, as follows:

asadmin> create-service testdomain

Upvotes: 3

Related Questions