客户端代码:
Hashtable ht = new Hashtable();
    
    ht.put(ctx.PROVIDER_URL, "t3://ip:port");//服务器
ht.put(ctx.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    ctx = new InitialContext(ht);
  anEJBHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow (ctx.lookup (homeClass.getName()), homeClass);  //取得ejb 的home接口

解决方案 »

  1.   

    忘了你的是jboss
    JBOSS的:
    java.naming.factory.initial
    "org.jnp.interfaces.NamingContextFactory"
    java.naming.provider.url
    "localhost:1099"
      

  2.   

    这样子还是有问题,请问如何解决?
    javax.naming.NameNotFoundException: PostgresDS not bound at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      

  3.   

    PostgresDS??好像jboss数据库没有配好
      

  4.   

    weblogic.jndi.WLInitialContextFactory这些上weblgic用的东西,你怎么放在这里,还不如 空着,