8. Working with Applications
Prev |  | Next

## 8. Working with Applications

## 8.1 Deploying Artifacts

In the context of Virgo Web Server, deploying refers to installing an artifact to the server and then starting it to make it available to users. Typically, when you install an artifact, VWS automatically starts it as long as the server is able to successfully resolve all its dependencies. For this reason, the terms deploying and installing are often used interchangeably.

You deploy artifacts to Virgo Web Server using either the hot-deploy directory on the file system or by using the Admin Console. The artifacts that you can deploy to VWS are:

- Bundles, including Web applications
- PARs
- Plans
- Configuration Files

### Hot Deploy

To hot deploy an artifact, copy it into the pickup directory (by default `$SERVER_HOME/pickup`):

    prompt$ cd /home/applications
    prompt$ cp helloWorld.war $SERVER_HOME/pickup

When the artifact is hot deployed, messages similar to the following appear in the log file:

    [2009-12-10 06:41:01.021] fs-watcher          <HD0001I> Hot deployer processing 'CREATED' event for file 'helloWorld.war'.
    [2009-12-10 06:41:01.087] fs-watcher          <DE0000I> Installing bundle 'helloWorld' version '0.0.0'.
    [2009-12-10 06:41:01.274] fs-watcher          <DE0001I> Installed bundle 'helloWorld' version '0.0.0'.
    [2009-12-10 06:41:01.397] fs-watcher          <DE0004I> Starting bundle 'helloWorld' version '0.0.0'.
    [2009-12-10 06:41:01.414] Thread-3            <WE0000I> Starting web bundle 'helloWorld' version '0.0.0' with context path '/helloWorld'.
    [2009-12-10 06:41:01.537] Thread-3            <WE0001I> Started web bundle 'helloWorld' version '0.0.0' with context path '/helloWorld'.
    [2009-12-10 06:41:01.550] start-signalling-1  <DE0005I> Started bundle 'helloWorld' version '0.0.0'.

If there is a problem with the deployment, such as the server being unable to resolve all dependencies, the console and log both show an error message to help you with troubleshooting.

If there are no problems, VWS automatically starts the artifact so that it is immediately available to users.

### Deploying Using the Admin Console

The Admin Console allows you to upload a file, which will be deployed automatically, from your local file system to the Virgo Web Server. As soon as Virgo Web Server deploys the artifact, it appears in the list of artifacts in the Admin Console. Note that the GUI for uploading varies according to the browser and operating system you use.

See Installing a New Artifact for details about using the Admin Console to install (deploy) an artifact. See The Web Admin Console for general informatin about the Admin Console.

### What Happens When You Deploy

When you deploy an artifact, either using hot-deployment or the Admin Console, Web Server copies the file to its work directory (`SERVER_HOME/work`) and registers it in its internal registry. The server then checks any dependencies the artifact might have to see if deployment can go ahead, and if all dependencies are resolved, Virgo Web Server starts the artifact. Because of all these additional internal activities, you should NOT simply copy the artifact into the `work` directory and assume it will be deployed, because Virgo Web Server will not do so.

### Deployment Ordering

When deploying bundles that have dependencies, it is important that you deploy them in the correct order. Virgo Web Server honors this ordering when it redeploys the artifacts on startup.

If you use hot deployment to deploy your artifacts, be sure to copy the corresponding files into the pickup directory one-by-one. Copying the files in one group, for example by using a single `cp` command. provides no guarantees of ordering.

### Restrictions

The Virgo Web Server does not support deploying fragment bundles.

Prev |  | Next
7.3 Service Dumps | Home | 8.2 Undeploying Artifacts