write(response, n.getMessage());
fail = true;
}
write(response, "<h2>Invoke AppTwo on different server</h2>");
try {
AppTwo proxy = (AppTwo) lookup(response, iCtx,
"ejb:jboss-ejb-multi-server-app-two/ejb//AppTwoBean!org.jboss.as.quickstarts.ejb.multi.server.app.AppTwo");
if (proxy != null) {
write(response, "Invocation #1 return node.name => " + proxy.getJBossNodeName() + "<br/>");
// second invocation shows whether the same or a different node is reached
write(response, "Invocation #2 return node.name => " + proxy.getJBossNodeName() + "<br/>");
} else {
fail = true;
}
} catch (Exception n) {
LOGGER.log(Level.SEVERE, "Failed to invoke AppTwo", n);