N.B. This installation only covers Windows servers.
To ensure everything is ready, open up a command prompt and type in the following: (ensuring that you include the “): "%JAVA_HOME%\bin\java" -version
.
If installed correctly, it should say something like this, notice it says Corretto-8. If yours doesn’t say this then please recheck each of the instructions from this guide.
Karaf is the OSGi container which hosts iGene. To install iGene, Karaf must first be running correctly as a service. This guide walks through installing and setting up Karaf as a service on Windows.
Go to the website https://karaf.apache.org/index.html and download the binary zip for 4.2.3.
Unzip Karaf and move it to the correct place (we’d suggest c:\Program Files). We recommend using 7Zip as the default zip program on Windows complained about path lengths being too long.
Edit the file C:\Program Files\apache-karaf-4.2.3\etc\org.osps4j.pax.url.mvn.cfg
and find the line that begins with
org.ops4j.pax.url.mvn.repositories and change it so it looks like this:
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2@id=central, \
http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, \
https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases, \
https://storage.googleapis.com/genial-maven-repository/releases, \
https://storage.googleapis.com/genial-maven-repository/snapshots@snapshots
There are three short steps to enable Karaf as a Windows service: Install the service-wrapper feature into Karaf, change some runtime settings regarding memory and then install the service.
Using Windows explorer, navigate to C:\Program Files\apache-karaf-4.2.3\bin\
and run the command karaf.bat
Alternativly, double-click on C:\Program Files\apache-karaf-4.2.3\bin\karaf.bat
directly.
Run the following commands:
feature:install service-wrapper
wrapper:install
Open up the service wrapper config file \apache-karaf-4.2.3\etc\karaf-wrapper.conf
with Notepad and make the following changes:
Replace all occurances of Program Files
with PROGRA~1
and modify the below lines in the config file to say:
# Uncomment to enable JMX
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=512
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=2048
Close the existing Karaf command prompt Window, and open up a new command prompt as administrator and change to the location where Karaf is installed cd C:\Program Files\apache-karaf-4.2.3\
, then run: bin\karaf-service.bat install
.
To run a command prompt as administrator, right click and select “Run as administrator”:
Open services, locate Karaf in the list and start it.
The service is setup to run as the “Local System” Account by default. If iGene will need to access any network drives then the server needs to run under its own user account. This can be changed through the service application.
Next connect the client and ensure the service is working. Run the command apache-karaf-4.2.3\bin\client.bat
, if it connects just type logout
to close the connection.
If you are receiving errors unzipping or moving files around:
If there is a problem starting the service check the logs located in apache-karaf-4.2.3\data\log
If in the logs you see the following error:
Error: Could not find or load main class Files\apache-karaf-4.2.3\etc.java.util.logging.properties
then remove the service by running in a terminal C:\Program Files\apache-karaf-4.2.3\bin\karaf-service.bat remove
and then carefully check through the instructions, ensuring that you’ve replaced the “Program Files” with “PROGRA~1”, then reinstall the service.