JavaService is a Win32 executable that allows any Java class to be run as an NT service.
It uses JNI's invocation API to create a Java Virtual Machine using any JNI compliant Java implementation.
JavaService is maintained by Multiplan Consultants Ltd as an Open Source project.
This is hosted by the ObjectWeb Consortium http://www.objectweb.org
and is available under an LGPL license.
Project description page at http://javaservice.objectweb.org
(this links to the source forge and many download versions).
Current documentation (included in the JavaService downloads) at:
http://javaservice.objectweb.org/js_doc_frame.html
Software downloads available at:
http://forge.objectweb.org/project/showfiles.php?group_id=137 (current and historical)
Original downloads were available from:
http://www.alexandriasc.com/software/JavaService/index.html (no longer reachable)
and updated versions were at: http://www.multiplan.co.uk/software/javaservice/index.html
-
Example JBoss install:
JBossService.exe -install JBoss {JDK_HOME}\jre\bin\{hotspot|server|classic}\jvm.dll -Djava.class.path={JDK_HOME}\lib\tools.jar;{JBOSS_BIN}\run.jar -start org.jboss.Main -stop org.jboss.Main -method systemExit -out {JBOSS_BIN}\stdout.log -err {JBOSS_BIN}\stderr.log -current {JBOSS_BIN} -depends mysql -manual -overwrite
-
Slow Tiles on JBoss{FOOTNOTE RED #1 1}
Another problem that this caused, is with the JBoss webloader, if a large number of applications were installed, any apps with dynamic includes (or tiles) would get incredibly slow. Applications deployed earlier would be fast, but each successive application would get slower.
//
-
JVM options and -server flag
By default on Windows, the HotSpot JVM defaults each thread stack to 1MB. Under load this could fail with a java.lang.OutOfMemoryError: unable to create new native thread error. The fix for this error is to lower the thread stack size, e.g. using "set JAVA_OPTS=-Xss128".
Here is an example JavaService install script which does this:
notepad install2.bat => set JAVA_HOME=C:\jdk1.6.0_06 set JBOSS_HOME=C:\jboss-4.0.2 set JAVA_OPTS=-Xms512m -Xmx512m -Xss512k -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+PrintGCDetails set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=7777 set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%JBOSS_HOME%\bin\run.jar set JBOSS_CLASSPATH=%CLASSPATH% set javadll=%JAVA_HOME%\jre\bin\server\jvm.dll set javatool=%JAVA_HOME%\lib\tools.jar set javarun=%JBOSS_HOME%\bin\run.jar set outlog=%JBOSS_HOME%\bin\stdout.log set errlog=%JBOSS_HOME%\bin\stderr.log copy /y javaservice.exe %JBOSS_HOME%\bin\JBossService.exe JBossService.exe -install JBoss "%javadll%" -Djboss.java.opts="%JAVA_OPTS%" -Djava.class.path=%CLASSPATH% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -server %JAVA_OPTS% -start org.jboss.Main -stop org.jboss.Main -method systemExit -out "%outlog%" -err "%errlog%" -current "%JBOSS_HOME%\bin" -manual <= Copies .jar, renames .exe, installs as Windows service
This example also sets other JVM options, and permits JConsole instrumentation (-Dcom.sun.management.jmxremote.port=7777). You can use JConsole to probe the running JavaService and make sure the settings are correct. You can also verify this in the boot.log.
These links contain some OutOfMemory errors, and the JVM flags to correct them:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4689767
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6250937
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197
Comments