Thank You for your help !

Yes you are right I do not understand and that is why I logged on
but perhaps that was another misunderstanding on my part that people
like me who do not understand the concepts of EJB  should
log on.

Can you please clarify the EXACT criteria of this list because I sense some
arrogant and derogatory remarks on your part unless
that is another misunderstanding on my part then excuse me.

Best Regards,
Z. RAHMAN

> -----Original Message-----
> From: Kevin Mukhar [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 3:43 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Calling methods
>
> "Rahman, Zahid" wrote:
> >
> >  Class      HelloWorldBean
> >  method    String Hello(){ .....}
> >
> > Interface          HelloWorldHome
> > only method     create();
> >
> > Using the above client code in my JSP I get an error to the effect  that
> > HelloWorldHome interface doesn't have a hello method.
> > which I agree with because it doesn't. However can you tell me how I can
> > call the hello method and more importantly how can
> > I get an instance of HelloWorld  class without  calling the create or
> finder
> > method of the HelloWorldHome first.
>
> First, as someone else mentioned, the method in your bean class should
> be Hello(String) and not Hello().
>
> Second, your client needs a reference of type HelloWorld, upon which to
> call the Hello(String) method. The only way to do that is to call the
> create method. So your client code needs to look like this:
>
> > HelloWorldHome helloworld = (HelloWorldHome)PortableRemoteObject.narrow
> >     (objref,HelloWorldHome.class);
> >     //NOT THIS: Output = helloworld.hello(Input);
>     HelloWorld hw = helloworld.create(); //create reference of type
> HelloWorld (remote interface)
>                                          //the actual object is the stub
> class
>     Output = hw.Hello(Input);
>
> The home interface returns a reference to the stub object. When you call
> the Hello(String) method, the stub calls the skeleton, the call is
> passed to the container, which then calls the HelloWorldBean class
> Hello(String) method. That is why the Hello method in the bean needs to
> have the same signature as the HelloWorldRemote interface.
>
> client -> stub (through reference of type remote interface) ->
>   over network -> skeleton -> EJB container -> EJB
>
> You clearly do not understand the concepts involved in EJBs. You should
> find an online tutorial or reference and try to understand the concepts
> behind EJBs. Try some of these links:
>
> http://theserverside.com/resources/book.jsp
> http://theserverside.com/
> http://java.sun.com/products/ejb/faq.html
> http://java.sun.com/products/ejb/training.html
>
> K Mukhar
>
> ==========================================================================
> =
> 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".

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