SHARE
TWEET

Untitled

a guest Apr 18th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  *
  3.  * @author Remi
  4.  */
  5. public class main {
  6.  
  7.     public void main(String args[]){
  8.         try{
  9.     //Contexte de nommage pour l'accès à l'annuaire JNDI du serveur Glassfish
  10.     Properties jNDIProperties = new Properties();
  11.     jNDIProperties.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
  12.     jNDIProperties.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
  13.     jNDIProperties.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
  14.     InitialContext namingContext = new InitialContext(jNDIProperties);
  15.     //Récupération d'un accès à l'EJB distant
  16.     String uri = "lien_distant_ejb";
  17.     ServiceCollaborateursRemote collabRemoteSvc =
  18.     (ServicesCollaborateursRemote) namingContext.lookup(uri);
  19.     }catch(NamingException ex){
  20.             System.out.println("Erreur");
  21.     }
  22.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top