trace: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14023850
The need to use statically-defined stubs depends only on what kind of client you have; it doesn't depend at all on where the EJB is that you're looking up or invoking. If your client is a WebSphere container that's been upgraded via the EJB 3.0 feature pack, then we have technology in the container itself that will dynamically generate the client-side stub for you in-memory when it's needed, assuming that you at least have the EJB remote interface packaged where the client can access it. So if your client is the WAS web container, EJB container, or application client container and the client environment has had the EJB 3.0 feature pack applied, you should not need to generate or package any client-side stubs with your client. If your client environment is something other than the above, then you will need to generate the client-side stubs with the createEJBStubs tool that comes with the EJB 3.0 feature pack, and package the resulting stubs in your client package. Here's a snippet of the documentation that covers this in more detail:
Just-In-Time Deployment
The EJB 3.0 Feature Pack adds a new feature to WebSphere application server called Just-In-Time Deployment. With Just-In-Time Deployment, the EJB container dynamically generates the wrapper, stub, and tie classes in-memory as needed when the application is running. Additionally, the web container and application client containers dynamically generate the stub class required for remote EJB invocations. Effectively, this means that you do not need to process EJB 3.0 modules, web modules that invoke EJB 3.0 beans, or client modules that invoke EJB 3.0 beans, through the EJBDeploy tool prior to running them in WebSphere.
The createEJBStubs tool
Even though the Just-In-Time deployment feature will, in many cases, dynamically generate the RMI-IIOP stub classes that are required for invocation of remote EJB interfaces, there remain some cases where these stub classes are not dynamically generated. For EJB 3.0 clients not running inside a WebSphere feature-pack-upgraded web container, EJB container, or client container, it is necessary for you to generate the stub classes with the createEJBStubs tool, then make the generated stubs available in the client environment's classpath. Typically you would accomplish this by copying the generated stubs to the location where the client's business interface class resides.
To summarize, the createEJBStubs tool must be used to generate client-side stubs for the following environments:
* "Bare" Java SE clients, where a Java SE JVM is the client environment
* WebSphere Application Server container environments without the EJB 3.0 feature pack applied
* Non-WebSphere application server environments