Hi OrionFolk :-)

Tonight I downloaded OrionServer 1.3.8 from the stable link off the
orionserver.com. There seems to be a bug having to do with
InitialContexts that was not there in version 1.0.3.

If you create an InitialContext object and pass in a Properties object
to the constructor containing the InitialContextFactory and so on, you
can successfully create an InitialContext object. Then you can call
close() on it. If you try to create it the second time, a
NullPointerException is thrown out.

Below is a small, simple class that definitively shows the bug. A
NullPointerException is thrown. The bug does not occur in Orion 1.0.3;
no NPE is thrown. Below my signature (see below) is the code and after
that is the stack trace.

I searched the archives and found nothing on this. Does anyone know
about this? Is there a workaround or some kind of fix? Any info at all?

thank you,
david


-- 
David Sims             [EMAIL PROTECTED]
Sims Computing, Inc.     www.simscomputing.com

#####

import java.util.*;
import javax.naming.*;

/**
In OrionServer 1.3.8, if you create an InitialContext, as shown below,
then close it, then try to create a second one, a NullPointerException
is thrown.
*/
public class OrionBug {

  private static final String ICF = "com.evermind.server.rmi.RMIInitialContextFactory";

  public static void main(String[] args) {
    try {
      Properties props = new Properties();
      props.setProperty(Context.INITIAL_CONTEXT_FACTORY, ICF);
      props.setProperty(Context.PROVIDER_URL, "ormi://localhost/orion-primer");
      props.setProperty(Context.SECURITY_PRINCIPAL, "admin");
      props.setProperty(Context.SECURITY_CREDENTIALS, "123");

      System.out.println("(1)");
      Context c = new InitialContext(props);
      c.close();
      System.out.println("(2)");
      c = new InitialContext(props);
      c.close();
      System.out.println("(3)");
      c = new InitialContext(props);
      c.close();
      System.out.println("(4)");
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
}



java.lang.NullPointerException
        at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(JAX)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
        at javax.naming.InitialContext.init(InitialContext.java:222)
        at javax.naming.InitialContext.<init>(InitialContext.java:198)
        at OrionBug.main(OrionBug.java:25)



Reply via email to