[GLASSFISH-19647] List-Jndi-Entries command is not returning value while running against cluster. Created: 07/Feb/13  Updated: 19/Sep/14  Resolved: 21/Feb/14

Status: Resolved
Project: glassfish
Component/s: admin
Affects Version/s: 4.0_b70
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: naman_mehta Assignee: martin.mares
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Attachments: Zip Archive test_results_GLASSFISH-19647.zip    
Issue Links:
Dependency
blocks GLASSFISH-19640 Need test-cases that use "list-jndi-e... Open

 Description   

Looks like this is old bug and might be affected earlier of 3.x releases.

Trying to run command against cluster having 2 instances.

./asadmin list-jndi-entries c1
It returns nothing on the console. Just shows message like 'Command list-jndi-entries executed successfully.'.

I did debug in cluster mode for 'ListJndiEntries' class. Actually command execution returns correct values. I can see ActionReport has TopMessage with 7 children but during replication it lost the data for children and returns nothing on the console.



 Comments   
Comment by Tom Mueller [ 07/Feb/13 ]

Since this is clustering related (non-RI), deferring this to 4.0.1.

Comment by jifeng [ 08/Sep/13 ]

Hi

After a few investigation about the source, I found it is cause by the following JSONObject:

{"command":"list-jndi-entries command","exit_code":"SUCCESS","subReports":
[{"message":"",★
"exit_code":"SUCCESS",
"children":
[{"message":"jdbc: com.sun.enterprise.naming.impl.TransientContext",
"properties":{}}
,{"message":"java:global: com.sun.enterprise.naming.impl.TransientContext",
"properties":{}}
,{"message":"jms: com.sun.enterprise.naming.impl.TransientContext",
"properties":{}},
{"message":"ejb: com.sun.enterprise.naming.impl.TransientContext",
"properties":{}},
{"message":"UserTransaction: com.sun.enterprise.transaction.startup.TransactionLifecycleService$2",
"properties":{}}]}]}

the message which is marked as "★" is empty
I have revised the source as follows:

com.sun.enterprise.admin.util.InstanceRestCommandExecutor.java
--- InstanceRestCommandExecutor.java	(revision 62634)
+++ InstanceRestCommandExecutor.java	(working copy)
@@ -43,6 +43,8 @@
 import com.sun.enterprise.admin.remote.ServerRemoteRestAdminCommand;
 import com.sun.enterprise.config.serverbeans.Server;
 import com.sun.enterprise.util.LocalStringManagerImpl;
+import com.sun.enterprise.util.StringUtils;
+
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -131,6 +133,9 @@
         try {
             executeCommand(params);
             copyActionReportContent(super.getActionReport(), aReport);
+            if(StringUtils.ok(getCommandOutput()))
+                aReport.setMessage(strings.getLocalString("ice.successmessage", 
+                        "{0}:\n{1}\n", getServer().getName(), getCommandOutput()));
         } catch (CommandException cmdEx) {
             ActionReport.ExitCode finalResult;
             if(cmdEx.getCause() instanceof java.net.ConnectException) {

it works fine,Could anybody help me to confirm about my changes?

Comment by jifeng [ 15/Nov/13 ]

Hi

Chris, martin

I runned the DevTest without applying my patch. most of the following cases are not passed.

Test class test method 1 test method 2
AdminObjectTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()
ConnectorResourceTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()
CustomResourceTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()
ExternalJndiResourceTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()
JavaMailResourceTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()
JdbcResourceTest testListJndiEntriesInCluster() testListJndiEntriesInStandaloneInstance()

When I runned the DevTest by applying my patch,all test cases are passed , so, my patch has no problem in my opinion,could you help me to review these changes

  • In the devTest set, testListJndiEntriesInCluster and testListJndiEntriesInStandaloneInstance methods are commented out. In order to test this bug, I canceled the comments of these two methods.
Comment by TangYong [ 15/Nov/13 ]

Martin, Chris

The attachment(test_results_GLASSFISH-19647.zip) is test results and you can see the results both applying the patch and not-applying the patch.

I think that the patch should be fine.

Thanks
Tang

Comment by Chris Kasso [ 19/Feb/14 ]

Martin has reviewed and agrees the changes are correct.

Comment by jifeng [ 21/Feb/14 ]

the issue has been checked in as r63134.
D:\glassfishV4\glassfish~svn\trunk\main\nucleus\admin\util\src\main\java\com\sun\enterprise\admin\util\InstanceRestCommandExecutor.java
D:\glassfishV4\glassfish~svn\trunk\main\nucleus\admin\util\src\main\java\com\sun\enterprise\admin\util\InstanceRestCommandExecutor.java
At revision: 63134

Generated at Sun Dec 11 01:37:12 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.