To retrieve EJB from JNDI provided by JBoss AS (version 4.x):
try {
Context c = new InitialContext();
myEjb = (EJBInterface) c.lookup(EJB_JNDI_NAME);
} catch (NamingException e) {
throw new ServletException("Error while connecting to server", e);
}
沒有留言:
發佈留言