6. Working with Applications

6.1 Deploying Artifacts

You can deploy artifacts to SpringSource dm Server using either the hot-deploy directory on the file system or by using the Admin Console.

Hot Deploy

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

prompt$ cp myapp.par $SERVER_HOME/pickup

When the artifact is hot deployed, a message similar to the following appears in the log file:

[2009-03-08 17:00:00.000] fs-watcher   <SPDE0010I> - Deployment of 'myapp.par' version '0' completed.

If there is a problem with the deployment the console and log both show an error message to help you with troubleshooting.

Manually Deploy

The Admin Console allows you to upload a file, which will be deployed automatically, from your local file system to the SpringSource dm Server. As soon as SpringSource dm 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.

When clicked, the ‘Upload’ button reloads the page. This may take a few seconds while the file is transmitted and deployed. The Admin Console displays a status message at the top of the page after it completes the deployment; if there were no problems, the displayed message is Application deployed. The following image shows three deployed artifacts.

See Chapter 3, The Web based Administration Console for additional details on using the Admin Console and the meaning of the displayed information.

What Happens When You Deploy

When you deploy an artifact, either using hot-deployment or the Admin Console, dm Server copies the file to its work directory (SERVER_HOME/work by default) 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, SpringSource dm 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 SpringSource dm Server will not do so.

Deployment Ordering

When deploying bundles that have dependencies, it is important that you deploy them in the correct order. SpringSource dm 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 SpringSource dm Server does not support deploying fragment bundles.