There are many open source projects out there that’s using Java Service Wrapper to run a process as a Windows service and as a daemon process in Linux. To make money of the excellent project they decided to screw everyone over and change to an atrocious licensing scheme. The crippled down community edition now doesn’t support 64bit Windows. Probably many other such nonsensical terms.
So, if you’re looking for alternatives there are several other nice projects out there. YAJSW is super easy to configure and use no native code.
You can generate a config file from a running Java process by giving the process ID. Found that it’s easy to start from here and then tweak the system paths according to your setup.
Following wrapper.conf file can be used to start any WSO2 Carbon product as a service in Windows. In the following configuration I’ve hard coded the working dir but that can easily be set to take from an environment variable just like the JVM path. I’ve removed comments from wrapper.conf for brevity.
wrapper.working.dir=C:\\test\\wso2greg-4.1.1
wrapper.java.app.mainclass= org.wso2.carbon.bootstrap.Bootstrap
wrapper.console.loglevel=INFO
wrapper.console.title="WSO2 G-Reg"
wrapper.ntservice.name="WSO2GREG"
wrapper.ntservice.displayname="WSO2 GREG"
wrapper.ntservice.description="Governance Registry"
wrapper.daemon.run_level_dir=${if (new File('\/etc\/rc0.d').exists()) return '\/etc\/rcX.d' else return '\/etc\/init.d\/rcX.d'}
wrapper.tray = true
wrapper.tray.port = 15002
wrapper.on_exit.0=SHUTDOWN
wrapper.on_exit.default=RESTART
wrapper.filter.trigger.0=Exception
wrapper.filter.script.0=scripts\/trayMessage.gv
wrapper.filter.script.0.args=Exception
placeHolderSoGenPropsComeHere=
wrapper.java.command = ${JAVA_HOME}\\bin\\java
wrapper.java.classpath.1 = .\\lib
wrapper.java.classpath.2 = ${JAVA_HOME}\\lib\\tools.jar
wrapper.java.classpath.3 = .\\bin\\org.wso2.carbon.bootstrap-3.2.2.jar
wrapper.java.classpath.4 = .\\lib\\endorsed
wrapper.app.parameter.1 = RUN
wrapper.app.parameter.2 = -Dcarbon.registry.root=\/
wrapper.app.parameter.3 = -Dcarbon.home=c:\\test\\wso2greg-4.1.1
wrapper.app.parameter.4 = -Dwso2.server.standalone=true
wrapper.app.parameter.5 = -Djava.command=${JAVA_HOME}\\bin\\java
wrapper.app.parameter.8 = -Dcarbon.xbootclasspath=;.\\lib\\xboot\\org.wso2.carbon.xboot-3.2.0.jar
wrapper.app.parameter.9 = -Djava.io.tmpdir=.\\bin\\..\\tmp
wrapper.app.parameter.10 = -Dwso2.carbon.xml=.\\bin\\..\\repository\\conf\\carbon.xml
wrapper.app.parameter.11 = -Dwso2.registry.xml=.\\bin\\..\\repository\\conf\\registry.xml
wrapper.app.parameter.12 = -Dwso2.user.mgt.xml=.\\bin\\..\\repository\\conf\\user-mgt.xml
wrapper.app.parameter.13 = -Dwso2.transports.xml=.\\bin\\..\\repository\\conf\\mgt-transports.xml
wrapper.app.parameter.14 = -Djava.util.logging.config.file=.\\bin\\..\\lib\\log4j.properties
wrapper.app.parameter.15 = -Dcarbon.config.dir.path=.\\bin\\..\\repository\\conf
wrapper.app.parameter.16 = -Dcarbon.logs.path=.\\bin\\..\\repository\\logs
wrapper.app.parameter.17 = -Dcomponents.repo=.\\bin\\..\\repository\\components
wrapper.app.parameter.18 = -Dcom.atomikos.icatch.file=.\\bin\\..\\lib\\transactions.properties
wrapper.app.parameter.19 = -Dcom.atomikos.icatch.hide_init_file_path=true
wrapper.app.parameter.20 = -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
wrapper.app.parameter.21 = -Dcom.sun.jndi.ldap.connect.pool.authentication=simple
wrapper.app.parameter.22 = -Dcom.sun.jndi.ldap.connect.pool.timeout=3000
wrapper.app.parameter.23 = -Dcarbon.classpath=.\\lib;${JAVA_HOME}\\lib\\tools.jar;;.\\bin\\org.wso2.carbon.bootstrap-3.2.2.jar;
wrapper.java.additional.1 = -Xbootclasspath\/a:;.\\lib\\xboot\\org.wso2.carbon.xboot-3.2.0.jar
wrapper.java.additional.2 = -Xms256m
wrapper.java.additional.3 = -Xmx512m
wrapper.java.additional.4 = -XX:MaxPermSize=256m
wrapper.java.additional.5 = -Dimpl.prefix=Carbon
wrapper.java.additional.6 = -Dcom.sun.management.jmxremote
wrapper.java.additional.7 = -Djava.endorsed.dirs=.\\lib\\endorsed;














