glassfish
  1. glassfish
  2. GLASSFISH-19647

List-Jndi-Entries command is not returning value while running against cluster.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_dev
    • Fix Version/s: 4.1
    • Component/s: admin
    • Labels:
      None
    • Environment:

      all

      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.

        Issue Links

          Activity

          Hide
          Tom Mueller added a comment -

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

          Show
          Tom Mueller added a comment - Since this is clustering related (non-RI), deferring this to 4.0.1.
          Hide
          jifeng added a comment -

          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?

          Show
          jifeng added a comment - 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?
          Hide
          jifeng added a comment -

          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.
          Show
          jifeng added a comment - 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.
          Hide
          TangYong added a comment -

          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

          Show
          TangYong added a comment - 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
          Hide
          Chris Kasso added a comment -

          Martin has reviewed and agrees the changes are correct.

          Show
          Chris Kasso added a comment - Martin has reviewed and agrees the changes are correct.
          Hide
          jifeng added a comment -

          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

          Show
          jifeng added a comment - 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

            People

            • Assignee:
              martin.mares
              Reporter:
              naman_mehta
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: