(ConverterHome)PortableRemoteObject.narrow(objref,
ConverterHome.class);
Converter currencyConverter = home.create();
double amount = currencyConverter.dollarToYen(200.00);
System.out.println(String.valueOf(amount));
amount = currencyConverter.yenToEuro(200.00);
System.out.println(String.valueOf(amount));
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
test.properties文件内容如下
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.provider.url=xxx.xxx.xxx.xxx:1099 (写上JBoss所在机器的IP)
然后运行CompileClient.bat和TestClient.bat,就可以享受成功的喜悦了.
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/