Bonjour Max,

usually I take this approach:

        String jndi = "package/Name/Protocol_RMI";
// The JNDI name, consisting of the package name (com.ibm => com/ibm) and
classname
        String url = "iiop://localhost:900/";
// url where the bean is deployed
        String icf = "com.ibm.ejs.ns.jndi.CNInitialContextFactory";
// well, ehh, the icf
        String message = "try this";

        try
        {
                        //default code
                Properties env = new Properties();
                env.put(Context.PROVIDER_URL, url);
                env.put(Context.INITIAL_CONTEXT_FACTORY, icf);
                Context context = new InitialContext(env);
                Object obj = context.lookup(jndi);

                        //specific code
                Protocol_RMIHome home =
(Protocol_RMIHome)PortableRemoteObject.narrow(obj, Protocol_RMIHome.class);
                Protocol_RMI bean = home.create();
                bean.functionName(message);
        }
        catch (Exception e){.....}



-----Original Message-----
From: Maxime Poulin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 10:28 PM
To: [EMAIL PROTECTED]
Subject: JNDI - InitialContext


Bonjour !

Got a question concerning JNDI. I have an application running on Tomkat
(Catalina). In this application, I need to access Enterprise Java Beans that
are contained in another tool, in this case, Inprise's AppServer. Now, I
must say that I am fairly unconfortable with JNDI. What I would like to know
is how do I find the class and url I have to pass to the the InitialContext
when I wish to obtain a Context in the Catalina project... ?

--> In the Catalina project, I have :

javax.naming.Context jndiContext = new javax.naming.InitialContext();

But of course, this does not work. I think I need to provide the class and
URL to access my EJB Container's context... How do I find this information
??

Thanks a lot !

Max.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


***********************************************************************
This E-Mail Message is intended exclusively for the addressee. If the
E-Mail was sent to you in error, please notify the sender immediately
by replying to this E-mail. We would then request you to destroy the
E-Mail and neither to use nor disclose the contents in any manner to
third parties, as the message could contain confidential information
which may be protected by the professional secrecy act.

This footnote also confirms that this E-mail message has been swept for
computer viruses.
***********************************************************************

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to