1. glassfish
  2. GLASSFISH-20648

EJB client frozen when ORBTCPConnectTimeouts is specified


    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0_b87_RC3
    • Fix Version/s: 4.1.1
    • Component/s: orb
    • Labels:
    • Environment:

      Windows 7


      TCP timeout value can be specified by the property ORBTCPConnectTimeouts.
      The format of this property is
      For example, this can be specified by -D option of java command or VMARGS for appclient command.
      When the same value is specified for the "initial" and "max", the client program is frozen.

      To reproduce the problem,
      1. Create a Hello World EJB sample program.
      2. When running the EJB client program, specify the ORBTCPConnectTimeouts option and invalid server name where EJB is not running.
      C:\>appclient -Dcom.sun.appserv.iiop.endpoints=invalidhost:3700 ejb30.SlessJavaClient

      3. EJB client does not timeout.(It stalls and no response.)

      I have created a sample program to reproduce the issue.
      To use the program,
      1. Edit the build.xml. Change the glassfish installation path in Line7.
      2. Execute "ant build" to compile. Then, "ant deploy" to deploy
      3. Execute "ant appclient". The program tries to connect to an invalid server and show exception. Then, exits and back to prompt. (This is expected. Not bug.)
      4. Execute "ant appclient_bug" is specified in this case. The program does not timeout and stalls.

      (For step 3 and 4, you can alternatively use "ant javaclient" and "ant javaclient_bug" to reproduce the bug.)

      This is from the Glassfish source code.
      It seems this part is causing the problem. original
      public boolean isExpired() {
      	return total_time > max_time_to_wait ;

      Changing >= in isExpried() solves the problem. See below for the suggestion. suggested
      public boolean isExpired() {
      	return total_time >= max_time_to_wait ;


        No work has yet been logged on this issue.


          • Assignee:
            Harshad Vilekar
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: