glassfish
  1. glassfish
  2. GLASSFISH-3888

Can't create new InitialContext with different host

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      3,888

      Description

      Following client code:
      package test;

      import java.util.Properties;
      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javax.naming.InitialContext;
      import javax.naming.NamingException;
      import org.logicstreams.server.engine.service.StatusService;

      /**
      *

      • @author Marek Mosiewicz
        */
        public class GlassfishTest {

      public static void main(String args[]) {
      try

      { Properties props = new Properties(); props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory"); props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost"); props.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); InitialContext ic; ic = new InitialContext(props); ic.lookup(StatusService.class.getCanonicalName()); props = new Properties(); props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory"); props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); //change host to non existing one props.setProperty("org.omg.CORBA.ORBInitialHost", "bleee"); props.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); ic = new InitialContext(props); //lookup succesed ic.lookup(StatusService.class.getCanonicalName()); }

      catch (NamingException ex)

      { Logger.getLogger(GlassfishTest.class.getName()).log(Level.SEVERE, null, ex); }

      }
      }
      will succeed althogh second host does not exists. Glassfish will always connect
      to first entered server no matter I will change parameters for second
      InitialContext. Same with port number.

      Marek Mosiewicz
      http://www.jotel.com.pl

        Activity

          People

          • Assignee:
            Harshad Vilekar
            Reporter:
            marekmosiewicz
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: