This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I am a fairly experienced Java developer, but am new to EJBs. I've gone through some books and tutorials, and I think I basically understand how to write EJB server components. All of the sample applications that I wrote run fine. Problem is, the client and server code of these sample apps all run on the same machine; the same JVM as well. What I am trying to do is write a separate, totally simple, Java app to run from the command line from another computer, separate from where the EJB container is running (I would access the server machine from the client machine over my home DSL hub.) So my (hopefully simple) question is... what do I need for the client app? Do I need certain JAR files for it to run? I assume it needs the JNDI classes, but does it need any EJB-specific classes as well? How about my custom Enterprise Java Bean... do I need to copy over any of my own code for the client to use? Presumably the client would need the home and remote interfaces in its classpath, else it couldn't compile, but does it need any other of my code? Presumably this is done all the time with EJBs, so hopefully someone knows the answer! Thanks in advance!
Dave Taubler<br />Specializing in <a href="http://taubler.com/articles/" target="_blank" rel="nofollow">Java and Web Development</a>
Hi Dave, how to package your client you can find in the Sun Tutorial. Additional you need to set some properties to find your remote server. Properties props= new Properties(); props.put( Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); //for JBoss Client props.put(Context.PROVIDER_URL,"Server ort"); The Factory depends on your application server e.g. BEA weblogic.jndi.WLInitialContextFactory JBoss org.jnp.interfaces.NamingContextFactory Additional you need some server dependent other jars (which should include JNDI). Regards Torsten
Dave, You will need to make sure your client has access to the Remote/Home Interfaces.
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Joined: May 15, 2001
Okay, thanks both for replying. It looks like part of what I need to do is figure out what classes/JARs Orion itself requires its clients to have, at least for the JNDI and EJB-specific functionality. William, are you saying that I should copy over the actual compiled home/remote interfaces that I write & compile myself?