Hi Patrik,

    I had the same problem and I look for some information about how to
resolv this problem. Although the aplications are in the same server the
connection become as if they was in differents servers. I used the
RMIContextFactory with the next code:


    Context context = null;
    Hashtable env = new Hashtable();

env.put("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialCon
textFactory");
   env.put("java.naming.provider.url", "ormi://localhost:<rmi
port>/<application name>");
    try
    {
      context = new InitialContext (env);
     context.lookup("EjbName");
    }
    catch (Exception e) {
            System.out.println("Conection error");
    }


If you don't change the values of rmi.xml in the Orion config you don't need
specify the rmi port. The applicacion name is the name that appear in
server.xml and identify the application. Is possible that you need especify
a username and password for connect to applicacion, I don't need it. For
specify these parametrers you need to put the next:

    env.put(Context.SECURITY_PRINCIPAL, "admin");
     env.put(Context.SECURITY_CREDENTIALS, "<password>");

I hope that this information can help you.

Best regards,



----- Original Message -----
From: "Patrik Strid" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Thursday, January 17, 2002 12:47 AM
Subject: Lookup EJB's in another application


> Hi,
>
> If you have two applications in the same orion
> container. One application with web components and
> another with just EJB's. From the application with web
> components, I want to lookup an EJB that is deployed
> in the other application - is that possible via the
> InitialContext or do I have to call it via an URL and
> getting the extra RMI call?
>
> I can get it to work using a provider URL to the other
> application, but using the InitialContext, the local
> context - it cannot find the bean, or more correct,
> the JNDI name could not be found.
>
> Any help is appreciated !
>
> Thanks,
> Patrik
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
>


Reply via email to