Also note that there is no harm to deploy the same service several times.
ant -Dusers.lib.dir=/home/services/jars deploy-services
Here is a list of properties that are used by both, local and remote deployment. Other, specific properties, are described later, in their particular sections.
users.lib.dir = <directory-name>
This property defines a directory with your own implementation. In most cases, you are not using jMoby directory for development of your classes - but you have them somewhere separately, in their own Java packages.
The Moses deployment will take all .jar files from this directory and copies them to the Tomcat (either directly or indirectly as described later in local and remote deployment).
users.lib.file = <fully-qualified-jar-file-name>
This property defines just one .jar file with your implementation. Otherwise, it is used in the same way as the property users.lib.dir described above. Actually, both these properties can be used in the same time, and contents of both are copied to Tomcat.
service.<your-service-name> = <your-class-name-implementing-this-service>
This is probably the most important property in the Moses deployment. You can have more such properties, one for each service you are going to deploy. For example, using the names of services introduced in other Moses documents:At least one such property must be found, otherwise Ant will complain and stop.service.Mabuhay = org.jmoby.tutorial.service.MabuhayImpl service.HelloBiomobyWorld = org.jmoby.tutorial.service.HelloBiomobyWorldImpl
Later, you will see that the same properties are used to define what services should be un-deployed. In that case, the implementation class part can be missing (property has just a name but no value).
services.list = <comma-separated list of service names>
This is an optional property that can limit the list of service names given by service.NAME properties. Note that it is not enough just to use this property and to forget to specify separate property service.NAME for each service.
Use this property if you have a larger list of your services (probably kept in build.properties) which you do not wish to touch, and you want to deploy only some of them now.
The property contains a name of a service, or a comma-separated list of service names. For example:For an un-deployment of services, this property is enough (you do not need to have separate properties service.NAME).services.list = Mabuhay services.list = Mabuhay,HelloBiomobyWorld
server.home = <your-server-directory>
Where your server is installed (e.g. /usr/local/tomcat or /usr/local/jboss). Note that moving things there will require a write access to some directories in the server directory, especially to directory where Axis has its libraries (which is, by default, <server-home>/<axis-home>/WEB-INF/lib).
If you have installed Axis in the server in a standard place, and if your server listens on a standard port, this is the only property you need to specify.
axis.relative.path = <directory-with-Axis-in-server>
Where is Axis installed in the server. Put here a path starting in <server-home>/ (but excluding this beginning). Default value is webapps/axis as for Tomcat (for JBoss the default value is server/default/deploy/axis.war).
server.host = <server-computer-name>
A machine name where the server is installed. Default is localhost. This is used by the Axis program when deploying new services. If it is not a localhost then it is called remote administration and Axis User's Guide tells about it:Note that by default, the Axis server is configured to only accept administration requests from the machine on which it resides - if you wish to enable remote administration, you must set the enableRemoteAdmin property of the AdminService to true. To do this, find the server-config.wsdd file in your webapp's WEB-INF directory. In it, you'll see a deployment for the AdminService. Add an option as follows:<service name="AdminService" provider="java:MSG"> <parameter name="className" value="org.apache.axis.util.Admin"/> <parameter name="allowedMethods" value="*"/> <parameter name="enableRemoteAdmin" value="true"/> </service>
server.port = <server-port-number>
A port where the server is listening. Default value is 8080.
axis.admin.url = <URL-path>
Used to find a correct piece of Axis when deploying services. Very rarely needed to be changed. Default value (which depends on a property defined above) is axis/servlet/AxisServlet. You can check this by typing in http://<server.home>:<server.port>/<axis.admin.url> in your browser.
wsdd.template = <filename-with-wsdd-template>
Deployment of a service uses a template that defines how to deploy the service. A standard template is in file src/webapps/standard.wsdd.template. Mostly you do not need to change it, but there may be situations where you need to provide your own template. For example, if you need to use special Axis chains and Axis handlers (don't worry if you do not know what they are).
After that, restart your server (because new classes where added there).ant deploy-services
It removes Axis configuration of your services but it does not clean up server/Axis lib directory. That would be a more complex task...ant undeploy-services
In order to make easy to use the resulting file on a target machine, you still need to set server and Axis properties before creating this file here. By default, the same properties are used as for local server:
server.home = <your-server-directory> axis.relative.path = <directory-with-Axis-in-server> server.host = <server-computer-name> wsdd.template = <filename-with-wsdd-template> server.port = <server-port-number> axis.admin.url = <URL-path>But you can also set them using different names (so you can have both set to different values if you deploy sometimes locally and sometimes for a remote machine). The alternative names start with cross:
cross.server.home = <your-server-directory> cross.axis.relative.path = <directory-with-Axis-in-server> cross.server.host = <server-computer-name> cross.server.port = <server-port-number> cross.axis.admin.url = <URL-path>And, of course, you still have to say which services you want to deploy - see the beginning of this document.
Then move the created file to a target machine, and log it there. Untar there the file - it creates directory moby-services-to-deploy-<date>. Change to this directory and type:ant deploy-remote
And again, restarting the server is often a good idea.sh deploy
If you want first to see if your properties were specified correctly, try first:
sh deploy info
sh deploy undeploy