[GLASSFISH-20675] password alias does not work for create-jmsdest Created: 02/Jul/13  Updated: 20/Dec/16  Resolved: 02/Jul/13

Status: Resolved
Project: glassfish
Component/s: jms
Affects Version/s: 4.0
Fix Version/s: 4.0_dev

Type: Bug Priority: Minor
Reporter: tak09 Assignee: David Zhao
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7



 Description   

Password alias does not work for create-jmsdest.

To reproduce the issue

1. Create password alias
asadmin create-password-alias jms-password

2. Set password alias
C:\>asadmin set server.jms-service.jms-host.default_JMS_host.admin-password=$

{ALIAS=jmspassword-alias}

3. Execute create-jmsdest

C:\>asadmin create-jmsdest --desttype queue JMSQueue2
remote failure: Unable to create JMS Destination.
Command create-jmsdest failed.

server.log shows the following error.

[2013-07-02T12:35:20.874+1000] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=35 _ThreadName=admin-listener(2)] [timeMillis: 1372732520874] [levelValue: 1000] [[
Error in dealiasing the password ${ALIAS=jmspassword-alias}

: Alias jmspassword-alias does not exist]]

[2013-07-02T12:35:20.887+1000] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=35 _ThreadName=Thread-4] [timeMillis: 1372732520887] [levelValue: 1000] [[
java.lang.SecurityException: JMX connector server jmxrmi: Failure detected during authentication com.sun.messaging.jmq.auth.api.FailedLoginException: [B4051]: Forbidden admin
at com.sun.messaging.jmq.jmsserver.management.agent.MQJMXAuthenticator.authenticate(MQJMXAuthenticator.java:135)
at javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:232)
at javax.management.remote.rmi.RMIServerImpl.newClient(RMIServerImpl.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

4. Note that create-jms-resource works as expected.
C:\>asadmin create-jms-resource --restype javax.jms.ConnectionFactory jms/DurableConnectionFactory
Connector resource jms/DurableConnectionFactory created.
Command create-jms-resource executed successfully.



 Comments   
Comment by David Zhao [ 02/Jul/13 ]

The case is invalid that you are using different password alias. It is jms-password when creating, and jmspassword-alias when saving.

1. Create password alias
asadmin create-password-alias jms-password

2. Set password alias
C:\>asadmin set server.jms-service.jms-host.default_JMS_host.admin-password=${ALIAS=jmspassword-alias}

Comment by tak09 [ 02/Jul/13 ]

I still have the same problem with the same password alias.
Please see below.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\>asadmin start-domain
Waiting for domain1 to start ..........................
Successfully started the domain : domain1
domain Location: C:\glassfish\glassfish-4.0\glassfish4\glassfish\domains\domain1
Log File: C:\glassfish\glassfish-4.0\glassfish4\glassfish\domains\domain1\logs\server.log
Admin Port: 4848
Command start-domain executed successfully.

C:\>asadmin create-password-alias jms-password-alias
Enter the alias password>
Enter the alias password again>
Command create-password-alias executed successfully.

C:\>asadmin set server.jms-service.jms-host.default_JMS_host.admin-password=$

{ALIAS=jms-password-alias}
server.jms-service.jms-host.default_JMS_host.admin-password=${ALIAS=jms-password-alias}

Command set executed successfully.

C:\>asadmin create-jmsdest --desttype queue JMSQueue2
remote failure: Unable to create JMS Destination.
Command create-jmsdest failed.

C:\>

Comment by David Zhao [ 02/Jul/13 ]

What are the error messages in server.log?

Comment by tak09 [ 02/Jul/13 ]

[2013-07-02T16:02:02.925+1000] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=34 _ThreadName=Thread-4] [timeMillis: 1372744922925] [levelValue: 1000] [[
java.lang.SecurityException: JMX connector server jmxrmi: Failure detected during authentication com.sun.messaging.jmq.auth.api.FailedLoginException: [B4051]: Forbidden admin
at com.sun.messaging.jmq.jmsserver.management.agent.MQJMXAuthenticator.authenticate(MQJMXAuthenticator.java:135)
at javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:232)
at javax.management.remote.rmi.RMIServerImpl.newClient(RMIServerImpl.java:199)

....... contiunes.

Comment by tak09 [ 02/Jul/13 ]

server.log and screenshot are available here.
https://www.dropbox.com/sh/ohsgcldetn89r2m/zecKTw3tWb

Comment by David Zhao [ 02/Jul/13 ]

The error message means wrong password - either alias is not found or the unaliased password is wrong.

1. Please make sure you can do create-jmsdest successfully without password alias, for example, asadmin set server.jms-service.jms-host.default_JMS_host.admin-password=admin

2. Make sure you created password alias with correct password: It is 'admin' by default.

I tried password alias by inputing password 'admin' at my environment, and create-jmsdest does work for me.

Comment by Kevin Dean [ 19/Dec/13 ]

This may be related to https://java.net/jira/browse/GLASSFISH-20938; see that issue for a description of the underlying problem.

Generated at Sun Apr 23 13:15:44 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.