• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Desperately need help! HFEjb: How to look up Remote Object in another machine

 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Based on the HFEJB, most of us running the exam in the local PC (remote object and client are in the same physical machine). But now I'm running j2ee server in another machine, let's say http://milkydv.cistech.com:1050, and running the client code in my local PC, so I got two issues:
1. how do I do the deploy using deploytool of j2eeRI? (Since original HFEJB deployment sends the AdviceAppClient.jar back, now since
deploytool is runing on http://milkydv.cistech.com:1050, how can AdviceAppClient.jar get back to my local PC?)

2. how do I update original client side code, to look up the deployed bean?
...
Context ic = new InitialContext();
Object o = ic.lookup("Advisor");
...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pass in the JNDI context information in the constructor of InitialContext(), so that you can browse remote JNDI directory.

Details can be refered to the API of InitialContext.

Nick
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you deploy, you need to set-up a JNDI name for your home so that outside people can find it. Dig around in the deploytool and you should find somewhere to type in a JNDI name.

Then, you can't just do the initial context without parameters, since you're client is external. You need to make a new Properties object and put the url of the other machine. You should be able to search google/groups for "InitialContext(props)" and see what people have done.

--Dale--
 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, guys, really solve my problem.

Hai
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic