Dashboard > DHIS Documentation > ... > Tools > Standalone Jetty
  DHIS Documentation Log In | Sign Up   View a printable version of the current page.  
  Standalone Jetty
Added by Torgeir Lorange Østby, last edited by Knut Staring on May 11, 2007  (view change)
Labels: 
(None)

Standalone Jetty

Download

  1. Download Jetty from http://jetty.mortbay.org. The latest version is available from http://sourceforge.net/project/showfiles.php?group_id=7322&package_id=106252.
  2. Extract the downloaded file whereever you like.

Jetty 6

All that is needed is to give your war file (either a downloaded war file or if you build the code your self, the one from dhis-web-portal/target) a name you like and copy it to Jetty's webapps/ directory.

You run Jetty by opening a command window, going to the Jetty directory and typying

java -jar start.jar

Now direct your web browser to [http://localhost:8080/<YOURWEBAPP>]

Jetty can also be installed as a service.

Jetty homepage
Jetty documentation

Configuration - Jetty 5

  1. Copy your war file (either a downloaded war file or if you build the code your self, the one from dhis-web-portal/target) to Jetty's webapps/ directory.
  2. Create a file called dhis.xml in Jetty's etc/ directory and copy and paste the code below into the file. Make sure that the name of the war file, which is dhis.war in the code below, matches the war file you copied to the webapps/ directory.
    dhis.xml
    <!DOCTYPE Configure PUBLIC
     "-//Mort Bay Consulting//DTD Configure 1.2//EN"
     "http://jetty.mortbay.org/configure_1_2.dtd">
    <Configure class="org.mortbay.jetty.Server">
    
      <Call name="addListener">
        <Arg>
          <New class="org.mortbay.http.SocketListener">
            <Set name="port">8080</Set>
          </New>
        </Arg>
      </Call>
    
      <Call name="addWebApplication">
        <Arg>/</Arg>
        <Arg>./webapps/dhis.war</Arg>
      </Call>
    
    </Configure>
  3. Create a file called velocity.properties in Jetty's resources directory and copy and paste the code below into the file.
    velocity.properties
    resource.loader=file, class
    
    file.resource.loader.description=Velocity File Resource Loader
    file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
    file.resource.loader.cache=true
    file.resource.loader.modificationCheckInterval=60
    
    class.resource.loader.description=Velocity Classpath Resource Loader
    class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    class.resource.loader.cache=true
    class.resource.loader.modificationCheckInterval=0
  4. In the same directory you'll find a log4j.properties file. In this file, make sure that all occurences of DEBUG are replaced with WARN.

Errors

If you get an error saying something like:

[DHIS2:...]
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
[DHIS2:...]

you need to replace ext/commons-logging.jar with http://www.ibiblio.org/maven2/commons-logging/commons-logging/1.1/commons-logging-1.1.jar. Then try again.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators