Thisi is the code that call for lookup ejb
| public void changeSceltaSede(ValueChangeEvent event){
| log.info("Sede selezionata #0 :: #1 ",
utenteRivalse.getSedeSelezionata().getCodice(),utenteRivalse.getSedeSelezionata().getDenominazione());
| //devo caricare le info della sede
| Context context;
| try {
| context = getContext();
| Accesso accessoBean =
(Accesso)context.lookup("java:comp/env/RivalseEar/AccessoBean/local");
| accessoBean.confermaSceltaSede();
| } catch (NamingException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
| private static Context getContext()throws NamingException{
|
| Context ctx = new InitialContext(System.getProperties());
| ctx.addToEnvironment("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
| ctx.addToEnvironment("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
| ctx.addToEnvironment("java.naming.provider.url",
"localhost:1099");
| return ctx;
| }
|
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142721#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...