This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In the code sample of chapter 3 of EJB in action, the client uses a EJB with a @Remote interface. However, the client in this sample runs within the same JVM as the EJB. So I don't see any remoteness in this sample.
If I runs the client code on another computer, how can the container on that computer find the remote EJB? Should I set the JNDI of that computer to the JNDI address of the EJB's computer? How can I do so?(I didn't find jndi.properties in my c:\sun\jdk)
I haven't seen anything on this in EJB in action yet. I am completely new to JNDI and have just read the appendix E to learn the basis of it.
Take a look at the jndi.properties shipped with the source code. Putting that in the classpath is all that's needed to inject/look-up a remote EJB.
We wanted to cover JNDI in greater detail, but were unable to do so due to some objections from a handful of technical reviewers close to the Spring community. We hope to have better JNDI coverage in the second edition. For now, take a look here: http://www.informit.com/articles/article.aspx?p=384904.
P.S.: For questions very specific to the book, try using the Manning author online forum: http://www.manning.com/panda/. That way, my co-author Debu Panda can help too. Also, I imagine the folks here don't enjoy answering questions specific to a given book :-).
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Joined: Nov 11, 2008
Thank you very much! I have to use a web proxy to access www.manning.com/panda because I guess it the site is blocked by the Great Firewall of China.
Joined: Feb 01, 2005
Wonderful--so either Manning or we have managed to anger the Chinese authorities somehow? LOL...