Standalone Jetty installation - Base for parcel application

This document helps to set up the environment. It does NOT instruct how to tune for performance or how things would be optimally configured for a production server.

Assumes pre-installed:

  • JDK 1.6+ (tested with 1.6.18)
  • Cygwin32 or 64, if windows environment (Windows 7 tested)
  • Maven 3+ (tested with 3.0.5)
  • PostgresSQL 9.1+ (tested with 9.3) with a oskaridb created for Oskari

Create oskaridb data base with pgAdmin or with psql

 WITH OWNER = postgres
   TABLESPACE = pg_default

Create postgis extension for the database.

(eg. in pgAdmin select oskaridb and in SQL window: CREATE EXTENSION postgis; )

Now you are able to create tables with geometry fields.

Setting up Jetty Hightide 8.1.14

1) Download

2) unpack to selected location (referred as {jetty.home})

3) Configure database connection pool by adding the following snippet in {jetty.home}/etc/jetty.xml:

<New id="OskariPool" class="">
      <New class="org.postgresql.ds.PGSimpleDataSource">
         <Set name="User">postgres</Set>
         <Set name="Password">[your pw]</Set>
         <Set name="DatabaseName">oskaridb</Set>
         <Set name="ServerName">localhost</Set>
         <Set name="PortNumber">5432</Set>

4) Edit the previous snippet to include actual database properties specific for your environment

5) Download PostgreSQL JDBC driver jar-file and copy it to {jetty.home}/lib/jdbc

6) Set default jetty.port for jetty run in etc/jetty.xml file

 <Call name="addConnector">
      <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
        <Set name="host"><Property name="" /></Set>
        <Set name="port"><Property name="jetty.port" default="8888"/></Set>

Setting up static frontend code to be server by Jetty

1) Go to jettys static content webapp

cd {jetty.home}\webapps\root

2) Get the frontend code from github:

git clone

3) Rename the created oskari folder to Oskari

mv oskari Oskari

Setting up and packaging the oskari backend

1) Get the backend code from github:

git clone

2) Ignore jetty-env.xml in /oskari-server/servlet-map path, if exists e.g. mv jetty-env.xml jetty-env-ignore.xml

3) Fix pom files for parcel extensions

  • Add to oskari/server/servlet-map-pom.xml

  • Add to oskari_server/servlet-map/pom.xml

    fi.nls.oskari.service oskari-control-example 1.0-SNAPSHOT

4) Compile and package the servlet by running

cd oskari-server
mvn clean package

5) Copy the war package from under oskari-server/webapp-map/target/ to {jetty.home}/webapps

6) Setup override properties for Oskari. Add an in {jetty.home}/resources/ (oskari.trustAllCerts/oskari.trustAllHosts bypasses certificate errors on ssl requests):

# set to true to get database populated with initial demo content

# true all ssl certs/hosts for debugging! configure certs on the server for production
# true all ssl certs/hosts for debugging! configure certs on the server for production

# url path to call for ajax requests/action routes

#PreParcel query and wfst url

#Url for print service (maplink) - same server as for GeoServer

#File path for temp pdf/png files
service.print.saveFilePath = {jetty.home}/webapps/root/print/

# proxy services
# adding property/parcel proxy
oskari.proxyservices = property, print


# Supported locales, comma separated and default first

Generate/populate database

1) Go to oskari-server/content-resources

2) Configure your database settings in content-resources/src/main/resources/

pass=[your pw]

3) Ignore jetty-env.xml in /oskari-server/servlet-map path, if exists e.g. mv jetty-env.xml jetty-env-ignore.xml

4a) Simple one-step setup

  • Create the initial db with default view (this isn't perfect but gets you started)

    mvn clean install exec:java -Doskari.dropdb=true -Doskari.setup=app-parcel


4b) Step-by-step setup

a ) Create and empty database by running (dropdb=true forces SQL execute even if there is existing tables):

    mvn clean install exec:java -Doskari.dropdb=true -Doskari.setup=create-empty-db

b) Register bundles to the database by running:

    mvn clean install exec:java -Doskari.dropdb=true -Doskari.setup=register-bundles

c) Add configurations for layers that you want to use in your application. View and parcel bundle refers to layer with certain IDs. These need to match with the inserted layers. To insert layers and permissions to view those layers see:


d) Edit references to layer ids and queryUrl in


e) Add a default view (the view configuration referes to content-resources/src/main/resources/json/views/{addview param})

    mvn clean install exec:java -Doskari.addview=parcel-as-default-view.json


The provided parcel-as-default-view.json defines parcel action route as:

"queryUrl" : "/oskari-map/?action_route=GetProxyRequest&serviceId=property",

This needs to be configured to an url responding to parcel loading

"stickyLayerIds" : [99,90]

The layer ids also need to be configured according to the system/configuration (oskari_maplayer table)

Startup application

1) Startup Jetty (cmd.exe in Windows)

cd {jetty.home}
java -jar start.jar

(or start with proxy setup, if any eg. java -jar start.jar -Dhttp.proxyPort=800 -Dhttp.nonProxyHosts=".yyy.xx|" --exec)

2) Start application http://localhost:8888/oskari-map in your browser

You can login with username "user" and password "user" as a normal user or "admin"/"oskari" as an admin user (no real difference yet)

Add print service support

1) Build oskari_server/servlet-printout ( mvn clean install) and copy oskari-printout-backend-1.0.x-SNAPSHOT.war from target path to {jetty.home}/webapps path

2) Install redis, if not yet in use (yum install redis)

  • option: create conf file for redis

        # Redis configuration file example
        # ...
        dir /data/redis/
       # ...
       maxmemory 1gb
       vm-swap-file /data/redis/redis.swap

3) Install fonts sudo yum install liberation-mono sudo yum install liberation-serif sudo yum install liberation-sans

4) Copy somewhere under {jetty.home}/resources/ and modify/check url values

5) Add to GeoServer startup.bat -Dfi.nls.oskari.imaging.config={jetty.home}/resources/

Sample startup.bat call "C:\Program Files (x86)\Java\jdk1.6.0_18\bin\java.exe" -DGEOSERVER_DATA_DIR="C:\Omat\GeoServer_2_4_0\data_dir" -Xmx512m -XX:MaxPermSize=128m -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -Djetty.port=8084 -Dfi.nls.oskari.imaging.config={jetty.home}/resources/ -Dhttp.proxyPort=800 -Dhttp.nonProxyHosts=".yyy.xx|" -Djetty.logs="C:\Omat\GeoServer_2_4_0\logs" -jar "C:\Omat\GeoServer_2_4_0\start.jar"

4) Restart GeoServer

Sample printout properties file

layersURL= layer.urlTemplate.wmslayer=%2$s%3$s layer.urltemplate.myplaces=$s&ID=myplaces_%1$s layer.urltemplate.myplaces.layers=oskari:my_places_categories layer.credentials.myplaces= layer.urltemplate.wfslayer=$s layer.urltemplate.statslayer=http://localhost/dataset/statslayer/service/actionroute layer.cache.exclude=90,91,250 layer.tiles.url.whitelist=^http:\/\/(www|demo|static|cdn)\.paikkatietoikkuna\.fi\/.+$|^http:\/\/(a|b|c|d)\.karttatiili\.fi\/.+$|^http:\/\/karttatiili\.fi\/.+$|^data:image\/png;base64,.+$|^data:image\/jpeg\;base64,.+|^/web\/.+$ layer.timeout.seconds=32 geojson.debug=true

Last modified: Fri Mar 17 2017 17:38:30 GMT+0200 (EET)