Configuration for Jetty (all versions)

   Jetty website

There are 2 main steps for enabling primrose to run within Jetty.

  1. Install jar file

    Copy primrose.jar into Jetty's user lib directory (eg JETTY_HOME/lib)

  2. Configure jetty.xml to load primrose:

    Under the main Configure tag in jetty.xml, define a pool, and a web console. There are two sections to add :
    • Define the pools to be loaded (all pools in the primrose config file will be loaded) :

      	<!-- Define a a factory to load all pools configured in the primrose config -->
      	<New class="uk.org.primrose.jetty.PrimroseDataSourceFactory">
      		<Set name="primroseConfigFile">/usr/jetty/conf/primrose.config</Set>
      	</New>
      				
      Make sure that the primroseConfigFile exists, and is configured correctly (see primroseConfig.html).

    • Define an webconsole to provide web access to all pools (optional)

      	<!-- Define a webconsole to provide web access to all pools (optional) -->
      	<New class="uk.org.primrose.vendor.jetty.WebConsoleFactory">
      		<Set name="username">admin</Set>
      		<Set name="password">admin</Set>
      	  	<Set name="port">8090</Set>
      	  	<Set name="logFile">/usr/jetty/logs/wbconsole.log</Set>
      	  	<Set name="logLevel">verbose,info,warn,error,crisis</Set>
      	</New>
      				
      Make sure that the logFile directory exists, and can be written to by jetty.
      Also make sure that the port is available.
      You may password protect the webconsole - if you not wish to, then just leave out the username and password elements.

Jetty should now be configured successfully to run primrose.