You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Yann BLAZART <ya...@externe.bnpparibas.com> on 2015/09/10 17:12:48 UTC

TomEE EJB remote

Hello !

I'm trying to use remote EJB from TomEE to TomEE.

But it doesn't work as expected.
In fact it's seems that in real it's connecting "locally" :

With this code, I get values from local tome not the remote one. But port is ok....

   // remote call to status.
        Properties p = new Properties();
        p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
        p.put("java.naming.provider.url", "http://" + card.getIpAdress() + ":" + card.getRemotePort() + "/tomee/ejb");
        InitialContext ctx;
        if (card.getRemotePort() == 33001) {
            try {
                ctx = new InitialContext(p);
               ctx.lookup("java:global");
                System.out.println(":::: GLOBAL !");
                NamingEnumeration<NameClassPair> list = ctx.list("java:global");
                while (list.hasMore()) {
                    System.out.println("**** Java global ::"+list.next().getName()); // Here I see values that exists in the local tome, not the remote
                                                                                                                                                          // the 'local ' run on port 33000 and th remote on 33001
                }
            } catch (NamingException ex) {
                java.util.logging.Logger.getLogger(MainUI.class.getName()).log(Level.SEVERE, null, ex);
            }


This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the internet 
cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed or falsified. 
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.