You deploy an EJB JAR module as described in Tools for Deployment.
If no JNDI name for the EJB JAR module is specified in the jndi-name element immediately under the ejb element in sun-ejb-jar.xml, or there is no sun-ejb-jar.xml file, a default, non-clashing JNDI name is derived. A warning message is logged recording the JNDI name used to look up the EJB JAR module.
You can keep the generated source for stubs and ties by adding the -keepgenerated flag to the rmic-options attribute of the java-config element in domain.xml. If you include this flag when you deploy the EJB JAR module, the generated source is kept in domain-dir/generated/ejb/j2ee-apps/app-name/module-name, if it is in an application, or domain-dir/generated/ejb/j2ee-modules/module-name, if it is in an individually deployed EJB JAR module. For more information about the -keepgenerated flag, see the Sun GlassFish Enterprise Server v2.1.1 Administration Reference.
Generation of stubs and ties is performed asynchronously, so unless you request their generation during deployment, stubs and ties are not guaranteed to be available immediately after deployment. To generate stubs and ties during deployment, use the --retrieve option of the asadmin deploy or asadmin deploydir command, or check the Generate RMIStubs Enabled box in the Admin Console.
You can use the asadmin get-client-stubs command to retrieve the stubs and ties whether or not you requested their generation during deployment. For details, see the Sun GlassFish Enterprise Server v2.1.1 Reference Manual.