Guru,
We would be specifying a client jar file location in the EJB's deployment descriptor with a tag <ejb-client-jar> </ejb-client-jar> which is optional. If the EJB client (
Servlet,
JSP etc) & the EJB runs in the same JVM (same server instance), then there is no need for this client jar to be made available explicitly, because they will have a common classpath.
But if you have your EJB client running in a different machine, then
you should copy all the required classes like Stub's etc in your EJB client location like what you do in RMI.
Usually, you would have all the Implementaion classes and Stubs (Both generated by Container Provider Tools) package along with Home & Remote interfaces to form a client jar file. Then this JAR would be included in the classpath of your EJB.
And if there are any external clients for the EJB, then this JAR can be used that provides the necessary classes.
To conclude, Yes we need to physically copy the necessary classes.