On Thu, 23 Sep 1999, Dave Glasser wrote:

> I'm just starting to dabble around with EJB in anticipation of a
> project that will use it. I've been reading Tom Valesky's book,
> "Enterprise JavaBeans, Developing Component-Based Distributed
> Applications."
>
> Anyway, I've gotten his "Hello EJB" example to work using WebLogic
> 4.03 and JDK 1.2.2, with the client and the server both running on the
> same machine. What I'm trying to figure out, and what he doesn't
> explain in his book,

I didn't explain it in my book because I was trying not to write a
Weblogic-specific book. There were a few areas where I couldn't avoid it,
of course, but I put a lot of effort into writing code that would work in
_any_ server (even ones that have yet to be written).


I'm guessing that the trouble you're having is because the InitialContext
needs to be fiddled with in order to work against a remote machine. Here's
a method from one of the Weblogic sample classes that should do the trick.

  static public Context getInitialContext() throws Exception {
Hashtable h = new Hashtable();    h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");    h.put(Context.PROVIDER_URL,
url);    if (user != null) {      System.out.println ("user: " + user);
h.put(Context.SECURITY_PRINCIPAL, user);      if (password == null)
password = "";      h.put(Context.SECURITY_CREDENTIALS, password);    }
return new InitialContext(h);  }


You'll probably also be missing some stub classes. The easiest way to make
sure you've got everything you need is to use automated tools.
Here's a document on how to prepare a client-side .zip file for
distribution with applications.
http://www.weblogic.com/docs/techdeploy/verbosetozip.html
and here's one for applets
http://www.weblogic.com/docs/techdeploy/appletarch.html



> is how to have the client run on a separate
> machine from the server. Somehow, the "HelloBean" name gets bound to
> localhost:7001, and I'll be damned if I can find where this happens.
> None of the Weblogic or Sun docs I've searched have been any help
> either. The only thing I've found is vague statements like "JNDI
> interfaces with other naming services..." Can someone point me in the
> right direction? I would appreciate it very much.
>
> ===========================================================================
> 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".
>

============================================================================
Tom Valesky -- [EMAIL PROTECTED] -- http://www.patriot.net/users/tvalesky

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