EJB3远程调用JNDI不同服务器链接代码

来源:互联网 发布:金牛软件破解版 编辑:程序博客网 时间:2024/05/29 09:39

glassfish3.1.2 服务器

            Properties props = new Properties();
            props.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory");
            props.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
            props.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            props.put("org.omg.CORBA.ORBInitialHost", "localhost");
            props.put("org.omg.CORBA.ORBInitialPort", "3700");
            InitialContext context = new InitialContext(props);
            HelloInterface remotet = (HelloInterface) context.lookup("java:global/HelloEjbTest/HelloSessionBean!com.aoli.interf.HelloInterface");

0 0
原创粉丝点击