在Netbeans之外启动企业应用程序客户端

时间:2010-12-06 01:36:15

标签: java java-ee

2 个答案:

答案 0 :(得分:0)

我必须更改用于连接的端口:

appclient -client RoadRunnerClient.jar -targetserver localhost:[port]

我必须查看我需要在管理控制台中使用哪个端口: ORB - > IIOP听众

答案 1 :(得分:0)

Netbeans 6.8与集成的Personal Glassfish v3服务器似乎存在配置问题。服务器默认安装其IIOP服务为40833,但JNDI的默认IIOP为3700.因此您会收到错误:

javax.naming.NamingException: Lookup failed for 'java:global/RoadRunner/RoadRunner-ejb/NewSessionBean!common.NewSessionBeanLocal' in SerialContext targetHost=localhost,targetPort=3700,orb's InitialHost=localhost,orb'sInitialPort=3700 [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext targetHost=localhost,targetPort=3700,orb'sInitial Host=localhost,orb'sInitialPort=3700 [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No]] 

解决方案是在JNDI上下文查找中添加一些代码。通常你可以说:

Context ctx = new InitialContext();



而是执行以下操作:

Properties jndiProps = new Properties();
            jndiProps.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory");
            jndiProps.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
            jndiProps.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            jndiProps.put("java.naming.provider.url", "iiop://localhost:40833");
            jndiProps.setProperty("org.omg.CORBA.ORBInitialHost", "127.0.0.1");
            jndiProps.setProperty("org.omg.CORBA.ORBInitialPort", "40833");

InitialContext ctx = new InitialContext(jndiProps);