This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes where are the stubs and skeletons deployed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "where are the stubs and skeletons deployed?" Watch "where are the stubs and skeletons deployed?" New topic
Author

where are the stubs and skeletons deployed?

Greg Watson
Greenhorn

Joined: Mar 12, 2005
Posts: 2
If you have your web application (for instance, a servlet) deployed in one JVM, and it makes use of EJBs in another JVM on another machine, do the stub and skeleton classes have to be deployed on both machines? Or does the RMIClassLoader mean that these generated classes only have to be deployed on the EJB server?

Thanks in anticipation...
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Greg,

Your question is very interesting and the answer is not very intuitive (or at least it wasn�t for me). The answer is no, you don�t need the stubs because as you�ve said the server is using the dynamic class loading capabilities provided by the RMI service. Therefore your client servlet needs only to include the home and remote interface classes (along with all other common classes), but no stubs. However in order for this to be true, your container must support dynamic proxies and you must compile the ejb properly. Most of the time your container will provide an rmi compiler (like weblogic.rmic) that is also compatible with older rmi versions. This compiler can also help you to create the ejb stubs for compatibility with the older versions. In that case your servlet client needs to include the generated stubs.


I think, therefore I exist -- Rene Descartes
Greg Watson
Greenhorn

Joined: Mar 12, 2005
Posts: 2
Thanks for the answer. The only thing now I don't understand is, if the remote & home interfaces aren't deployed along with the client code, doesn't that cause a problem with having to import these interfaces in the class which actually does the JNDI lookup and creates the EJB?
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704

The home and remote interfaces must be included in both the client and server jars. Is only the traditional RMI stubs and skeletons that don�t need to be generated.
[/code]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where are the stubs and skeletons deployed?