users@glassfish.java.net

Re: how to execute list-components using non-default admin-port

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Thu, 06 Jan 2011 16:23:20 -0600

It looks like there are several RFE possibilities here:

- docs issue to request that every subcommand manual page include
"asadmin-options" in the synopsis with a note that information about the
asadmin-options is on the asadmin manual page.

- command_line_interface issue to request a better error message when
unable to connect to the server, but the --host option is the default
localhost. In this case, asadmin should be able to look at the local
domain information and see what the port might be to determine if the
server(s) is running.

Do you want to file these (so your name is on the issue)?

Tom


On 1/6/2011 2:37 PM, Jonathan Benoit wrote:
> Thanks, that clarified it. I was looking for list-components help to
> tell me about --port option. It would be nice to know when looking for
> help in remote subcommand that they take standard asadmin options.
> (i.e. --port, etc.) I didn't see the asadmin help state that all
> remote subcommands take standard asadmin options. does it, or should it?
>
> Also, can this reporting be more helpful when I'm not using default
> admin port? Maybe something like:
>
> $ ./asadmin list-components
> Remote server does not listen for requests on [localhost:4848].
> Detected that server is up, but using non-default admin-port, so pass
> --port <port_number> option.
> No such local command, list-components. To run remote commands, start
> the application server (e.g. 'asadmin start-domain').
> Command list-components failed.
>
> From this output below, I knew I did asadmin start-domain, and pieced
> together that it is a port problem when i saw 4848, knowing I switched
> my admin-port to non-default. Would be better to be explicitly told
> it's a port problem if we know that is cause.
>
> On 1/6/2011 11:03 AM, Tom Mueller wrote:
>> Use the --port option. All remote asadmin subcommands take the standard
>> asadmin options (--port, --host, --secure, --terse, --echo, etc.) These
>> are documented in the asadmin manual page and are not repeated for every
>> subcommand.
>>
>> To avoid having to pass the argument on every command, you can set the
>> AS_ADMIN_PORT environment variable.
>>
>> Tom
>>
>>
>> On 1/6/2011 8:51 AM, Jonathan Benoit wrote:
>>> hi all,
>>> how do you list-components for domain that listens on non-default
>>> admin port? if i change domains/domain1/domain.xml
>>> admin-listener port="46612" i get errors below. if i change admin-port
>>> back to 4848 it doesn't error.
>>>
>>> // start domain1 on non-default port 46612
>>> $ ./asadmin start-domain domain1
>>> Waiting for domain1 to start ................
>>> Successfully started the domain : domain1
>>> domain Location: /space/glassfish3/glassfish/domains/domain1
>>> Log File: /space/glassfish3/glassfish/domains/domain1/logs/server.log
>>> Admin Port: 46612
>>> Command start-domain executed successfully.
>>>
>>> $ ./asadmin list-components
>>> Remote server does not listen for requests on [localhost:4848]. Is the
>>> server up?
>>> No such local command, list-components. To run remote commands, start
>>> the application server (e.g. 'asadmin start-domain').
>>> Command list-components failed.
>>>
>>> $ ./asadmin list-components domain
>>> Remote server does not listen for requests on [localhost:4848]. Is the
>>> server up?
>>> No such local command, list-components. To run remote commands, start
>>> the application server (e.g. 'asadmin start-domain').
>>> Command list-components failed.
>>>
>>> $ ./asadmin list-components domain1
>>> Remote server does not listen for requests on [localhost:4848]. Is the
>>> server up?
>>> No such local command, list-components. To run remote commands, start
>>> the application server (e.g. 'asadmin start-domain').
>>> Command list-components failed.
>>> $
>>>
>>>
>>> //change admin-port back to 4848, it doesn't error:
>>> $ ./asadmin start-domain domain1
>>> Waiting for domain1 to start ....
>>> Successfully started the domain : domain1
>>> domain Location: /space/glassfish3/glassfish/domains/domain1
>>> Log File: /space/glassfish3/glassfish/domains/domain1/logs/server.log
>>> Admin Port: 4848
>>> Command start-domain executed successfully.
>>>
>>> $ ./asadmin list-components
>>> Authentication failed with password from login store:
>>> /space/hudson/.asadminpass
>>> Enter admin password for user "admin">
>>> [snip]
>>>
>>>
>>> Help doesn't show it taking a --port option, should it?
>>>
>>> $ ./asadmin --help list-components
>>> Can't find remote man page, looking locally...
>>>
>>> asadmin Utility Subcommands list-components(1)
>>>
>>> NAME
>>> list-components - lists deployed components
>>>
>>> SYNOPSIS
>>> list-components [--help]
>>> [--long={false|true}] [--resources] [--subcomponents]
>>> [--type type] [target]
>>>
>>> DESCRIPTION
>>> Note -
>>>
>>> The list-components subcommand is deprecated. Use the
>>> list-applications subcommand instead.
>>>
>>> The list-components subcommand lists all deployed Java EE
>>> components.
>>>
>>> If the --type option is not specified, all components are
>>> listed. If the type option is specified, you must specify a
>>> type. The possible types are listed in the Options section
>>> in this help page.
>>>
>>> If multiple versions of a module or application are
>>> deployed, this subcommand lists all versions. To list which
>>> version is enabled, set the --long option to true. For more
>>> information about module and application versions, see the
>>> Module and Application Versions in Oracle GlassFish Server
>>> 3.1 Application Deployment Guide.
>>>
>>> This subcommand is supported in remote mode only.
>>>
>>> OPTIONS
>>> --help
>>> -?
>>>
>>> Displays the help text for the subcommand.
>>>
>>> --long
>>> If true, displays whether each module or application
>>> listed is enabled. The default is false.
>>>
>>> --resources
>>>
>>> Lists the application-scoped resources for each com-
>>> ponent. If the --subcomponents option is also used,
>>> lists the application-scoped resources for each
>>>
>>> Java EE 6 Last change: 29 Nov 2010 1
>>>
>>> asadmin Utility Subcommands list-components(1)
>>>
>>> component within an application.
>>>
>>> --subcomponents
>>>
>>> Lists the subcomponents of each component. The subcom-
>>> ponents listed depend on the component type. For exam-
>>> ple, for a Java EE application (EAR file), modules are
>>> listed. For a web application, servlets and JSP pages
>>> are listed. For an EJB module, EJB subcomponents are
>>> listed.
>>>
>>> --type
>>> Specifies the type of the components that are to be
>>> listed. The options are as follows:
>>>
>>> o application
>>>
>>> o appclient
>>>
>>> o connector
>>>
>>> o ejb
>>>
>>> o web
>>>
>>> o webservice
>>> If no type is specified, all components are listed.
>>>
>>> OPERANDS
>>> target
>>>
>>> This is the name of the target upon which the subcommand
>>> operates. The valid values are:
>>>
>>> server
>>> Lists the components for the default server instance
>>> server and is the default value.
>>>
>>> domain
>>>
>>> Lists the components for the domain.
>>>
>>> cluster_name
>>> Lists the components for the cluster.
>>>
>>> Java EE 6 Last change: 29 Nov 2010 2
>>>
>>> asadmin Utility Subcommands list-components(1)
>>>
>>> instance_name
>>>
>>> Lists the components for a particular stand-alone
>>> server instance.
>>>
>>> EXAMPLES
>>> Example 1 Listing Components
>>>
>>> This example lists the connector components. (cciblackbox-
>>> tx.rar was deployed.)
>>>
>>> asadmin> list-components --type connector
>>> cciblackbox-tx <connector>
>>> Command list-components executed successfully
>>>
>>> EXIT STATUS
>>> 0 subcommand executed successfully
>>>
>>> 1 error in executing the subcommand
>>>
>>> SEE ALSO
>>> list-applications(1), show-component-status(1)
>>>
>>> asadmin(1M)
>>>
>>> Oracle GlassFish Server 3.1 Application Deployment Guide
>>>
>>> Java EE 6 Last change: 29 Nov 2010 3
>>>
>>> Command list-components executed successfully.