users@glassfish.java.net

Re: How do I undeploy an app with the CLI asadmin when I have multiple doma

From: <glassfish_at_javadesktop.org>
Date: Wed, 26 Sep 2007 11:16:16 PDT

Good question and sorry that the answer is not evident from how asadmin works.

Here is how asadmin works.


asdmin-program ----establishes HTTP/S connection ---> Domain Identified by an admin server host
name, admin port number (e.g. 4848), admin user name and admin password.

Then the domain invokes necessary objects and gets back to asadmin. This is how ~95% of
asadmin commands (e.g. deploy, create-*-resource ...) work.

Thus, the key point is behind the scenes, asadmin relies on a domain that has *unique* admin
host name and port number at a given point in time!

As you can see, no two domains can have both admin host name and port number at the same
time and asadmin has no difficulty finding the correct domain.

Now comes the question of default values. asadmin defaults admin host to "localhost" and
port to "4848" and thus, when you don't specify these values, they are defaulted to these and
thus asadmin *by default* tries to contact localhost:4848 and if the username and password
are correct, will operate on that domain.

In your case, domainpre and domain1 either:
- must have different admin port number, or
- must not be running at the same time.

If you want to undeploy it from domain1, find its port and do:
- asadmin undeploy --port <domain1's port> MyJavaEE.

Regards,
Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=237223