• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
...
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, guys, really solve my problem.

Hai
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic