[jboss-user] [JNDI/Naming/Network] - Re: NameNotBoundException

bambooh do-not-reply at jboss.com
Wed Apr 9 09:24:09 EDT 2008


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#4142721

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142721



More information about the jboss-user mailing list