Prev | Next

TOC | Index

J2EETM Developer's Guide
Advanced Topics


Deployment: Behind the Scenes

If you're an advanced user, you may want to know what happens inside the J2EE server when you deploy an application. Here's the story:

1. The server transfers the application .jar file from the deploytool process to the j2ee process.

After this step, the server uses the transferred copy of the application .jar file to do its work, and the .jar file that was manipulated by the deployment tool is left unchanged.

2. The j2ee process saves the application .jar file in its repository at this directory:

$J2EE_HOME/repository/<hostname>/applications
3. The j2ee process opens the application .jar file, reads the deployment descriptors, and for each bean generates the source code for the home interface and EJBObject implementation. These source code files are placed in the following directory:

$J2EE_HOME/repository/<hostname>/gnrtrTMP
4. The j2ee process compiles the home interface and the EJBObject implementations and then runs the rmic command on the class files.

This step creates the stubs and skeletons for the home and remote objects. The server sends the client .jar file to the deployer and saves the file with the name chosen at the start of the deployment process.

5. The server packages the generated classes into a server .jar file and stores the .jar file in the repository.

6. The server creates a client .jar file that contains the home and remote interfaces and the stubs for the home and remote objects.

The server sends the client .jar file to the deployer and saves the file according to the name chosen at the start of the deployment process.

The location of the client .jar file is added to the CLASSPATH environment variable on any client that calls the application. Then, at runtime, the appropriate stub classes can be loaded so that the client can successfully locate objects, for example, the home object for an enterprise bean in the application.

If the .jar file has any Web components, the EJB server copies the components to and installs them on the Web server.

7. If you started j2ee with the -singleVM option (the default), the j2ee process hosts the enterprise beans in its process and creates containers for them.

If you started the j2ee process with the -multiVM option, the server starts a process which loads the server .jar file and creates containers for the enterprise beans.

8. At this point, the deployment process is complete.



Prev | Next

TOC | Index


Copyright © 2000 Sun Microsystems, Inc. All rights reserved.