properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
      properties.put(Context.PROVIDER_URL, "t3://hello的IP地址:端口");
      ctx = new InitialContext(properties);
...不知道对不对,我不太懂的.

解决方案 »

  1.   

    这个是weblogic的,sun的j2eeserver的参考实现,怎么配置呢?我也想知道,Up.
      

  2.   

    weblogic的Context.INITIAL_CONTEXT_FACTORY 为 weblogic.jndi.WLInitialContextFactory
    如果是sun的j2eeserver的你不妨去网上查一下 
    Context.PROVIDER_URL 还是t3://hello的IP地址:端口
      

  3.   

    是不是J2EE  SDK(J2EE  RI),自己查一下,以前的帖子有吧WebSphere:  
    Context.INITIAL_CONTEXT_FACTORY  
     "com.ibm.websphere.naming.WsnInitialContextFactory  "  
    Context.PROVIDER_URL  
     "iiop://localhost:900  "  
    Weblogic:  
    Context.INITIAL_CONTEXT_FACTORY  
       "weblogic.jndi.WLInitialContextFactory  "  
    Context.PROVIDER_URL  
       "t3://127.0.0.1:7001  "               
     
       J2EE  SDK(J2EE  RI):  
    Context.INITIAL_CONTEXT_FACTORY  
       "com.sun.jndi.cosnaming.CNCtxFactory  "  
    Context.PROVIDER_URL  
       "iiop://127.0.0.1:1050  "  
     
    SilverStream:  
    Context.INITIAL_CONTEXT_FACTORY  
     "com.sssw.rt.jndi.AgInitCtxFactory  "  
    Context.PROVIDER_URL  
     "sssw://localhost:80  "   
      
    OC4J
    Context.INITIAL_CONTEXT_FACTORY
    "com.evermind.server.rmi.RMIInitialContextFactory"
    Context.PROVIDER_URL
    "ormi://127.0.0.1/"  
     
    JBOSS的:
    java.naming.factory.initial
    "org.jnp.interfaces.NamingContextFactory"
    java.naming.provider.url
    "localhost:1099"    
    WAS5:
    Context.INITIAL_CONTEXT_FACTORY  
     "com.ibm.websphere.naming.WsnInitialContextFactory  "  
    Context.PROVIDER_URL  
     "iiop://localhost:2809  "