Beyond The GUI

Using Oddjob without Oddjob Explorer.

The Command Line

Oddjob can be run from the command line using the following command:

java -jar run-oddjob.jar

For further options use:

java -jar run-oddjob.jar -h

Additional arguments are passed into Oddjob and are set as the args property of the top Oddjob. If the command line is


java -jar run-oddjob -f greeting.xml "Hello World!"

and greeting.xml contained:

<oddjob id="this">
  <echo text="${this.args[0]}"/>
</oddjob>

Then the result would be:

Hello World!

Stopping Oddjob

Oddjob has a shutdown hook that attempts to stop Oddjob cleanly when the virtual machine detects it is being asked to terminate. Usually this happens with ctr-c or the kill signal, but the exact implementation is machine dependant.

If a job is hanging and refuses stop Oddjob will forcably exit after 5 seconds.

In the Linux Background

The following command will run Oddjob as a Linux background process.

nohup java -jar /home/rob/java/oddjob-0.22.0/run-oddjob.jar &

It is advisable to keep the first level of Oddjob configuration to a minimum. Here is an example startup configuration:

<oddjob id="this" >
  <sequential name="Server Startup Sequence" >
    <rmireg name="RMI Registry" />
    <server id="server"
               name="Oddjob Server"
               url="service:jmx:rmi://ignored/jndi/rmi://localhost/my-oddjob"
               root="${shared}" />
    <oddjob name="Run Immediately"
               file="myjobs.xml" />
    <foler name="Manual Jobs" >
	  <stop name="Shutdown the Server"
		       job="${server}" />
    </folder>    
  </sequential>
</oddjob>

This configuration has 'Shutdown the Server' job which allows a client to stop the server remotely.

As an XP Service

To be done. Starting points are:

The Web Front End

Oddjob comes with a web interface. To run the web interface you need a Servlet Engine or application server like tomcat.

To install Oddjob on tomcat simply copy the oddjob.war file supplied with the binary distribution of Oddjob to the webapps directory of tomcat and then restart tomcat.

When Things Go Wrong

By default Oddjob writes to a log file called oddjob.log which will be in the same directory that Oddjob was started from.

The logging configuration is in the log4j.properties file located in oddjob_dir/opt/class. Changing the logging level to debug may provide additional information.


Index Top