GlassFish 5, standalone client
“Решил замахнуться на нашего Вильяма…” (с) Берегись автомобиля.
Появилось время на самокапание, решил попробовать сервер приложений GlassFish в связке с RMI клиентом на Java. Написал простейший ejb с методом sayHello.
@Stateless
public class MainSessionBean implements MainSessionBeanRemote {
@Override
public String sayHello() {
return “Hello world!”;
}
}
Ну и в клиенте, его вызов.
try {
props.load(new FileInputStream(“jndi.properties”));
InitialContext ctx = new InitialContext(props);
MainSessionBeanRemote bean =
(MainSessionBeanRemote)ctx.lookup(
“java:global/CorpServer/CorpServer-ejb/MainSessionBean”);
System.out.println(bean.sayHello());
} catch …






