Windows Service
This tutorial describes the required steps to configure JOSSO 2 Server as a Windows OS service.
Prerequisites
- JOSSO 2 already installed in Windows
- Oracle's JDK Installer
- Administrator access to the Windows Server.
Installing the Service
Verify Java Install
JOSSO Uses an OS service wrapper to start, that is not compatible with executables installed in paths tha use spaces. This requires that Java is installed in a different folder than the default (C:\Program Files\Java). One option would be to install it at C:\atricore\Java, and this is the value we'll use during this tutorial.
Set Up JOSSO Service
Install JOSSO Service Wrapper
Now that Java is installed in the proper location, we can start JOSSO 2 again and set up the service wrapper. For that all we have to do is run the wrapper:install command on JOSSO's command line. This is what the output looks like:
karaf@josso-ee>wrapper:install
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\netty
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\jna
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\groovy
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\yajsw
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\regex
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\extended
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\extended\velocity
Creating missing directory: C:\atricore\josso-ee-2.4.0\lib\wrapper\templates
Creating file: C:\atricore\josso-ee-2.4.0\bin\installService.bat
Creating file: C:\atricore\josso-ee-2.4.0\bin\uninstallService.bat
Creating file: C:\atricore\josso-ee-2.4.0\bin\wrapper-setenv.bat
Creating file: C:\atricore\josso-ee-2.4.0\bin\wrapper.bat
Creating file: C:\atricore\josso-ee-2.4.0\etc\josso2-wrapper.conf
Creating file: C:\atricore\josso-ee-2.4.0\etc\josso2-wrapper-stop.conf
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\wrapper.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\wrapperApp.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\netty\netty-3.2.4.Final.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\jna\jna-3.3.0.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\jna\jnacontrib-platform-3.3.0.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-configuration-1.7-SNAPSHOT.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-vfs-2.0-SNAPSHOT.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\groovy\groovy-all-1.8.0.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-httpclient-3.0.1.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-codec-1.3.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-collections-3.2.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-io-1.3.1.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-lang-2.4.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-logging-1.1.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\commons\commons-cli-2-SNAPSHOT.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\yajsw\ahessian.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\core\regex\jrexx-1.1.1.jar
Creating file: C:\atricore\josso-ee-2.4.0\lib\wrapper\lib\extended\velocity\velocity-1.6.3.jar
Setup complete. You may want to tweak the JVM properties in the wrapper configuration file:
C:\atricore\josso-ee-2.4.0\etc\josso2-wrapper.conf
before installing and starting the service.
To install the service, run:
C:> C:\atricore\josso-ee-2.4.0\bin\installService.bat
Once installed, to start the service run:
C:> net start "josso2"
Once running, to stop the service run:
C:> net stop "josso2"
Once stopped, to remove the installed the service run:
C:> C:\atricore\josso-ee-2.4.0\bin\uninstallService.bat remove
karaf@josso-ee>
==== Configure Windows Service
Now that the wrapper has been installed, the next step is to add JOSSO as an OS service. Stop JOSSO 2 and open a new Windows command line as Administrator. Access JOSSO2 bin folder (i.e. C:\atricore\josso-ee-2.4.0\bin) and you will find a new file: installService.bat.
C:\atricore\josso-ee-2.4.0\bin>installService.bat
C:\atricore\josso-ee-2.4.0\bin>cd C:\atricore\josso-ee-2.4.0\bin\
C:\atricore\josso-ee-2.4.0\bin>call wrapper-setenv.bat
"java" -Xmx30m -jar "C:/atricore/josso-ee-2.4.0/lib/wrapper/wrapper.jar" -i "C:/atricore/josso-ee-2.4.0/etc/josso2-wrapper.conf"
Jul 20, 2015 8:38:34 AM org.apache.commons.vfs.VfsLog info
INFO: Using "C:\Users\ADMINI~1\AppData\Local\Temp\vfs_cache" as temporary files store.
************* INSTALLING josso2 ***********************
Service josso2 installed
Press any key to continue . . .
C:\atricore\josso-ee-2.4.0\bin>
TIP
If you need to uninstall the service, you can run the uninstallService.bat script as administrator.
Start JOSSO Using Windows Service Manager
You can now open the Windows Services manager and look for the Atricore JOSSO 2 Service to start JOSSO.
Information about JOSSO and the wrapper can be found in the following log files:
- JOSSO2_HOME\data\log\atricore.log
- JOSSO2_HOME\data\log\wrapper.log.