To quench ur thirst of wonder u shd read material on
jndi. Infact EJB uses jndi for looking up the objects.

-Manish

--- tanuja <[EMAIL PROTECTED]> wrote:
> Hello!
>         I am trying to learn ejb from the past 1
> day.
>
> I installed the J2ee server on my machine  and wrote
> the classes
> Converter.class  and ConverterHome.class
> implementing the EJBObject and
> EJBhome interfaces   resp.
>
> In the client portion  I have this program
>
> public class ConverterClient {
>    public static void main(String[] args) {
>        try {
>            Context initial = new InitialContext();
>            Object objref =
> initial.lookup("MyConverter");
>
>            ConverterHome home =
>
> (ConverterHome)PortableRemoteObject.narrow(objref,
>
> ConverterHome.class);
>
>            Converter currencyConverter =
> home.create();
>            double amount =
> currencyConverter.dollarToYen(100.00);
>
> System.out.println(String.valueOf(amount));
>            amount =
> currencyConverter.yenToEuro(100.00);
>
> System.out.println(String.valueOf(amount));
>
>        } catch (Exception ex) {
>            System.err.println("Caught an unexpected
> exception!");
>            ex.printStackTrace();
>        }
>    }
> }
>
>
>
> When I say  " java classpath... ConverterClient"
> this program runs
>
>
> I do not understand the following :
>         In the case of servlet I very well
> understand how the client is
> connecting to the server,(coz in the browser I type
> http://machinename:8080/servlet/xyz ) but in the
> case of ejb how a
> connection to the server is  established?
>
> 1) - How does it know MyConverter is associated with
> what object?If the
> j2ee is not running on  my machine then  what will I
> give as an argument
> to lookup ?
>
>
===========================================================================
> 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".
>
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===========================================================================
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