aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Desperately need help!  HFEjb: How to look up Remote Object in another machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Desperately need help!  HFEjb: How to look up Remote Object in another machine " Watch "Desperately need help!  HFEjb: How to look up Remote Object in another machine " New topic
Author

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

Hai Lin
Ranch Hand

Joined: May 23, 2004
Posts: 79
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

Joined: Nov 07, 2003
Posts: 4982
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


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
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

Joined: May 23, 2004
Posts: 79
Thanks a lot, guys, really solve my problem.

Hai
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Desperately need help! HFEjb: How to look up Remote Object in another machine
 
Similar Threads
RMI basics help!!!
desperatly need help: j2ee RI's deploytool got exception on my unix port
Local Client Vs. Remote Client
Client/Server command line options
NX: extends DB and fire listener