glassfish
  1. glassfish
  2. GLASSFISH-20781

list-jndi-entries command does not display Portable JNDI Name while deploying an EJB lite

    Details

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

      GlassFish 4

      Activity

      Hide
      lzg5039 added a comment -

      when execute the command of "asadmin list-jndi-entries --context java:global",the following exception will happen

      remote failure: Naming Exception caught. Invocation exception: Got null ComponentInvocation
      Invocation exception: Got null ComponentInvocation
      Command list-jndi-entries failed.
      

      it is a bug?

      Show
      lzg5039 added a comment - when execute the command of "asadmin list-jndi-entries --context java:global",the following exception will happen remote failure: Naming Exception caught. Invocation exception: Got null ComponentInvocation Invocation exception: Got null ComponentInvocation Command list-jndi-entries failed. it is a bug?
      Hide
      TangYong added a comment -

      This must be a issue, for --context,

      --context
      The name of the JNDI context or subcontext. If context is not specified, all entries in the naming service are returned. If context (such as ejb) is specified, all those entries are returned.

      So, the jira itself has told us that in 4.0, list-jndi-entries has been unavailable in some cases.

      Show
      TangYong added a comment - This must be a issue, for --context, --context The name of the JNDI context or subcontext. If context is not specified, all entries in the naming service are returned. If context (such as ejb) is specified, all those entries are returned. So, the jira itself has told us that in 4.0, list-jndi-entries has been unavailable in some cases.
      Hide
      jifeng added a comment - - edited

      Hi
      Chris

      This is the exact precise place where the failure happens:

      com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.java
      // Some comments here
       private String getComponentId() throws NamingException {
              String id;
      
              ComponentInvocation ci;
              if (invMgr==null) {
                  ci= habitat.<InvocationManager>getService(InvocationManager.class).getCurrentInvocation();
              } else {
                  ci= invMgr.getCurrentInvocation();
              }
              
              if (ci == null) {
                  throw new NamingException("Invocation exception: Got null ComponentInvocation ");★
              }
      ......
      }
      

      ci==null, so the code which is marked as "★" will throw the NamingException

      I did debug for 'SerialContextProviderImp' class ,i found the Portable JNDI Name objects had been bound in SerialContextProviderImpl object。
      however, when i executed the command of "asadmin list-jndi-entries --context java:global", the command did not find the Portable JNDI Name objects in 'SerialContextProviderImpl' class 。
      the processing logic is right?

      Show
      jifeng added a comment - - edited Hi Chris This is the exact precise place where the failure happens: com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.java // Some comments here private String getComponentId() throws NamingException { String id; ComponentInvocation ci; if (invMgr== null ) { ci= habitat.<InvocationManager>getService(InvocationManager.class).getCurrentInvocation(); } else { ci= invMgr.getCurrentInvocation(); } if (ci == null ) { throw new NamingException( "Invocation exception: Got null ComponentInvocation " );★ } ...... } ci==null, so the code which is marked as "★" will throw the NamingException I did debug for 'SerialContextProviderImp' class ,i found the Portable JNDI Name objects had been bound in SerialContextProviderImpl object。 however, when i executed the command of "asadmin list-jndi-entries --context java:global", the command did not find the Portable JNDI Name objects in 'SerialContextProviderImpl' class 。 the processing logic is right?
      Hide
      jifeng added a comment - - edited

      Hi
      Chris

      I have revised the source as follows:

      com.sun.enterprise.naming.impl.SerialContext.java
      Index: SerialContext.java
      ===================================================================
      --- SerialContext.java	(revision 62639)
      +++ SerialContext.java	(working copy)
      @@ -92,7 +92,7 @@
       
           private static final String JAVA_URL = "java:";
       
      -    private static final String JAVA_GLOBAL_URL = "java:global/";
      +    private static final String JAVA_GLOBAL_URL = "java:global";
       
             }
       
      

      It works fine,
      Could you help me to review these changes?
      If it is fine, could you tell me how to run the admin tests,i ran the QL tests and all of the QL tests are passed.

      Show
      jifeng added a comment - - edited Hi Chris I have revised the source as follows: com.sun.enterprise.naming.impl.SerialContext.java Index: SerialContext.java =================================================================== --- SerialContext.java (revision 62639) +++ SerialContext.java (working copy) @@ -92,7 +92,7 @@ private static final String JAVA_URL = "java:" ; - private static final String JAVA_GLOBAL_URL = "java:global/" ; + private static final String JAVA_GLOBAL_URL = "java:global" ; } It works fine, Could you help me to review these changes? If it is fine, could you tell me how to run the admin tests,i ran the QL tests and all of the QL tests are passed.
      Hide
      Chris Kasso added a comment -

      The change looks good to me. To run the dev tests:

      svn co https://svn.dev.java.net/svn/glassfish-svn/trunk/v2/appserv-tests

      Set APS_HOME to the appserv-tests directory created from the checkout (e.g. /work2/ws/v2/appserv-tests)
      Set S1AS_HOME to your GF build/install (e.g. .../distributions/glassfish/target/stage/glassfish4/glassfish)

      Run the tests:

      ant -D-Xmx912M all -Dverbose=true

      You can add -Dteststorun=XXX to control the tests to run (where XXX is things like cli or cluster, etc)

      Show
      Chris Kasso added a comment - The change looks good to me. To run the dev tests: svn co https://svn.dev.java.net/svn/glassfish-svn/trunk/v2/appserv-tests Set APS_HOME to the appserv-tests directory created from the checkout (e.g. /work2/ws/v2/appserv-tests) Set S1AS_HOME to your GF build/install (e.g. .../distributions/glassfish/target/stage/glassfish4/glassfish) Run the tests: ant -D-Xmx912M all -Dverbose=true You can add -Dteststorun=XXX to control the tests to run (where XXX is things like cli or cluster, etc)
      Hide
      jifeng added a comment - - edited

      Hi
      Chris

      Thank you for telling me how to run devTest.

      But I found that there are some problems in DevTest of Admin modules
      when I runned the test case without applying my patch.

      In admin modules ,A total of 20 modules should be tested ,thereinto,
      only 13 ones can be passed, while 7 of them can not be passed.
      The test result of using my patch is exactly the same with the
      test result without my patch , so, my patch is without problem in my opinion.

      I have checked the reason which causes the admin module occur error,
      some errors have nothing with glassfish, it is devTest's problem.

      If Chris thinks that it is necessary to amend these problems, I'll be glad to do this job.

      Show
      jifeng added a comment - - edited Hi Chris Thank you for telling me how to run devTest. But I found that there are some problems in DevTest of Admin modules when I runned the test case without applying my patch. In admin modules ,A total of 20 modules should be tested ,thereinto, only 13 ones can be passed, while 7 of them can not be passed. The test result of using my patch is exactly the same with the test result without my patch , so, my patch is without problem in my opinion. I have checked the reason which causes the admin module occur error, some errors have nothing with glassfish, it is devTest's problem. If Chris thinks that it is necessary to amend these problems, I'll be glad to do this job.
      Hide
      TangYong added a comment -

      Chris,

      The attachment is the test results before applying the patch and after applying the patch.
      Pl. seeing it.

      From the test results, I think that the patch looks fine.

      Best Regards
      Tang

      Show
      TangYong added a comment - Chris, The attachment is the test results before applying the patch and after applying the patch. Pl. seeing it. From the test results, I think that the patch looks fine. Best Regards Tang
      Hide
      Chris Kasso added a comment -

      I think the fix is fine. Since the same tests fail before you apply the patch I wouldn't worry about them in this case.

      Show
      Chris Kasso added a comment - I think the fix is fine. Since the same tests fail before you apply the patch I wouldn't worry about them in this case.
      Hide
      jifeng added a comment -

      the issue has been checked in as r63141.
      D:\glassfishV4\glassfish~svn\trunk\main\appserver\common\glassfish-naming\src\main\java\com\sun\enterprise\naming\impl\SerialContext.java
      D:\glassfishV4\glassfish~svn\trunk\main\appserver\common\glassfish-naming\src\main\java\com\sun\enterprise\naming\impl\SerialContext.java
      Completed: At revision: 63141

      Show
      jifeng added a comment - the issue has been checked in as r63141. D:\glassfishV4\glassfish~svn\trunk\main\appserver\common\glassfish-naming\src\main\java\com\sun\enterprise\naming\impl\SerialContext.java D:\glassfishV4\glassfish~svn\trunk\main\appserver\common\glassfish-naming\src\main\java\com\sun\enterprise\naming\impl\SerialContext.java Completed: At revision: 63141

        People

        • Assignee:
          Chris Kasso
          Reporter:
          TangYong
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: