dev@glassfish.java.net

Re: asadmin with anonymous login

From: Lloyd Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 11 Aug 2009 18:37:22 -0700

Aha!

I had the following in my environment:

export AS_ADMIN_USER=admin

Tthe confusing part is that asadmin NEVER reports an authentication
failure:

llcMP:code llc$ asadmin get domain.locale

Command get executed successfully.

Now watch things fail. Why isn't an authentication failure reported?

llcMP:code llc$ export AS_ADMIN_USER=admin

llcMP:code llc$ asadmin get domain.locale
CLI001 Invalid Command: get
Command get failed.

llcMP:code llc$ export AS_DEBUG=true
llcMP:code llc$ asadmin get domain.locale
CLASSPATH= /v3/glassfishv3/bin/../glassfish/modules/admin-cli.jar
Commands: [get, domain.locale]
Command class: com.sun.enterprise.admin.cli.optional.GetCommand
Failed to load command class: java.lang.ClassNotFoundException:
com.sun.enterprise.admin.cli.optional.GetCommand
0 descriptor = jar:file:/Volumes/Spare4/work/v3/glassfishv3/glassfish/
modules/admin-cli.jar!/CLIDescriptor.xml
URI: /__asadmin/get?Xhelp=true
URL: com.sun.enterprise.admin.cli.util.HttpConnectorAddress_at_3041876
URL: http://localhost:4848/__asadmin/get?Xhelp=true
CLI001 Invalid Command: get
URI: /__asadmin/list-commands?Xhelp=true
URL: com.sun.enterprise.admin.cli.util.HttpConnectorAddress_at_3fb6772a
URL: http://localhost:4848/__asadmin/list-commands?Xhelp=true
Command get failed.



Lloyd

On Aug 11, 2009, at 6:31 PM, Lloyd Chambers wrote:

> Default domain as installed by unjarring glassfish.zip, see my other
> message.
>
> On Aug 11, 2009, at 6:04 PM, Bill Shannon wrote:
>
>> I don't understand why login would succeed and then help would fail.
>>
>> Help me understand how to reproduce this problem. Did you have the
>> domain configured with any authentication? Or is this just the
>> default domain with anonymous login?
>>
>>
>> Lloyd Chambers wrote on 8/11/09 3:42 PM:
>>> Bill,
>>>
>>> Is this the expected behavior? That is should login OK, but then
>>> fail?
>>> Shouldn't it fail the login command?
>>>
>>> Lloyd
>>>
>>> llcMP:samples llc$ *asadmin --user anonymous login*
>>> CLASSPATH= /v3/glassfishv3/bin/../glassfish/modules/admin-cli.jar
>>> Commands: [--user, anonymous, login]
>>> Command class: com.sun.enterprise.admin.cli.optional.LoginCommand
>>> params: {}
>>> operands: []
>>> login --host localhost --port 4848 --user anonymous --
>>> interactive=true
>>> --echo=false --terse=false
>>> Enter admin user name [default: anonymous]>
>>> URI: /__asadmin/version?Xhelp=true
>>> URL: com.sun.enterprise.admin.cli.util.HttpConnectorAddress_at_494b6bed
>>> URL: http://localhost:4848/__asadmin/version?Xhelp=true
>>> params: {}
>>> operands: []
>>> version --host localhost --port 4848 --user anonymous
>>> --interactive=false --echo=false --terse=false
>>> URI: /__asadmin/version
>>> URL: com.sun.enterprise.admin.cli.util.HttpConnectorAddress_at_7bafb0c7
>>> URL: http://localhost:4848/__asadmin/version
>>> ------- RAW RESPONSE ---------
>>> Signature-Version: 1.0
>>> message: GlassFish v3 (build llc-private)
>>> use-main-children-attribute: false
>>> exit-code: SUCCESS
>>>
>>>
>>> ------- RAW RESPONSE ---------
>>> PROCESSING MANIFEST...
>>> Login information relevant to admin user name [anonymous]
>>> for host [localhost] and admin port [4,848] stored at
>>> [/Users/llc/.asadminpass] successfully.
>>> Make sure that this file remains protected.
>>> Information stored in this file will be used by
>>> asadmin commands to manage the associated domain.
>>> Command login executed successfully.
>>>
>>>
>>> llcMP:samples llc$ *asadmin help deploy*
>>> CLASSPATH= /v3/glassfishv3/bin/../glassfish/modules/admin-cli.jar
>>> Commands: [help, deploy]
>>> params: {}
>>> operands: [deploy]
>>> help --host localhost --port 4848 --user admin --interactive=true
>>> --echo=false --terse=false deploy
>>> Command class: com.sun.enterprise.admin.cli.optional.DeployCommand
>>> Failed to load command class: java.lang.ClassNotFoundException:
>>> com.sun.enterprise.admin.cli.optional.DeployCommand
>>> 0 descriptor =
>>> jar:file:/Volumes/Spare4/work/v3/glassfishv3/glassfish/modules/
>>> admin-cli.jar!/CLIDescriptor.xml
>>> Deprecated syntax, instead use:
>>> asadmin --help deploy [options] ...
>>> Getting password from ~/.asadminpass
>>> params: {help=true}
>>> operands: []
>>> deploy --host localhost --port 4848 --user admin --interactive=true
>>> --echo=false --terse=false --help=true
>>> URI: /__asadmin/deploy?help=true
>>> URL: com.sun.enterprise.admin.cli.util.HttpConnectorAddress_at_4876db09
>>> URL: http://localhost:4848/__asadmin/deploy?help=true
>>> ------- RAW RESPONSE ---------
>>> Signature-Version: 1.0
>>> message: Error authenticating
>>> use-main-children-attribute: false
>>> exit-code: FAILURE
>>>
>>>
>>> ------- RAW RESPONSE ---------
>>> PROCESSING MANIFEST...
>>> com.sun.enterprise.cli.framework.CommandException: remote failure:
>>> Error
>>> authenticating
>>>
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.handleResponse(RemoteCommand.java:
>>> 557)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.handleResponse(RemoteCommand.java:
>>> 530)
>>> at
>>> com.sun.enterprise.admin.cli.remote.RemoteCommand.access
>>> $400(RemoteCommand.java:68)
>>> at
>>> com.sun.enterprise.admin.cli.remote.RemoteCommand
>>> $1.doCommand(RemoteCommand.java:307)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.doHttpCommand(RemoteCommand.java:
>>> 364)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin
>>> .cli.remote.RemoteCommand.executeRemoteCommand(RemoteCommand.java:
>>> 271)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.executeCommand(RemoteCommand.java:
>>> 247)
>>> at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:
>>> 287)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin
>>> .cli
>>> .remote.RemoteCommand.executeAndReturnOutput(RemoteCommand.java:329)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.getManPage(RemoteCommand.java:428)
>>> at
>>> com
>>> .sun.enterprise.admin.cli.HelpCommand.getSource(HelpCommand.java:
>>> 127)
>>> at
>>> com
>>> .sun
>>> .enterprise.admin.cli.HelpCommand.executeCommand(HelpCommand.java:
>>> 87)
>>> at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:
>>> 287)
>>> at
>>> com
>>> .sun
>>> .enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.java:
>>> 183)
>>> at com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:
>>> 128)
>>> Caused by:
>>> com.sun.enterprise.admin.cli.remote.RemoteFailureException:
>>> Error authenticating
>>>
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin
>>> .cli.remote.ManifestManager.processGeneric(ManifestManager.java:112)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.ManifestManager.process(ManifestManager.java:68)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin
>>> .cli
>>> .remote
>>> .RemoteResponseManager.handleManifest(RemoteResponseManager.java:
>>> 109)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin
>>> .cli
>>> .remote.RemoteResponseManager.process(RemoteResponseManager.java:83)
>>> at
>>> com
>>> .sun
>>> .enterprise
>>> .admin.cli.remote.RemoteCommand.handleResponse(RemoteCommand.java:
>>> 542)
>>> ... 14 more
>>>
>>
>
> Lloyd Chambers
> lloyd.chambers_at_sun.com
> GlassFish Team
>
>
>

Lloyd Chambers
lloyd.chambers_at_sun.com
GlassFish Team