Thanks for the clarification, Asheesh.

One more thing, what's the significance of ejb-ref elements in web.xml?
Do you have to specify them?

Thanks again.
-Velmurugan Periasamy.


-----Original Message-----
From: asheesh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 12:46 AM
To: [EMAIL PROTECTED]
Subject: Re: How to call EJB's from Servlet in a portable J2EE way?


Earlier in tomcat 3.1 i use to get context by following

Context ctx = new InitialContext();
Object obj = ctx.lookup("mybean");

Then in tomcat 3.2.3 i follow following technique, which i suppose is applic
able to all j2ee compliant servers

        Hashtable env = new Hashtable();
        env.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.inprise.
j2ee.jndi.CtxFactory" );
        env.put( javax.naming.Context.URL_PKG_PREFIXES, "com.inprise.j2ee.jn
di" );
        Context ctx = new InitialContext(env);
        Object obj = ctx.lookup("mybean");
 ---- This is reference to the Borland AppServer, pls do check for the JBOSS
implementation of it, u may have to include few class files in ur class path
.

regards
asheesh

----- Original Message -----
From: Vel Periasamy <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 27, 2001 4:48 AM
Subject: How to call EJB's from Servlet in a portable J2EE way?


> We're planning to build a Servlet/JSP application(using Tomcat).
> We might also use EJB's if required (using JBoss).
>
> What's the best portable J2EE way to call EJB's on JBoss from a
> servlet in Tomcat? We have Tomcat 3.2.3.
>
> I understand this should be done by acquiring an initial context
> and doing a lookup for the EJB. But does Tomcat support the initial
> context stuff? Also, I want to know how we should configure the
> ejb-ref/ejb-local-ref elements in web.xml(Are these mandatory?)
>
> Thanks for your help.
> -----------------------------------------------------------
> Velmurugan Periasamy
> [EMAIL PROTECTED]
> http://www.aegis.net
> Personal Home Page: http://www.geocities.com/velmurugan_p
> -----------------------------------------------------------
>
>
>

Reply via email to