Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

2.3.5.  Running as a Service under Microsoft Windows

You can configure the server to run as a service under Microsoft Windows, and configure it to start automatically if desired.
There are two ways that the JBoss Enterprise Application Server can be run under Windows.
Option 1. Use JBoss Native for Windows
You can use JBossNative. Download the appropriate version based on your system and go through the README-service.txt which lists down the steps for running JBoss as a service.
Option 2. Use the JavaServiceWrapper
You can use Java Service Wrapper and manage it using the JMX.
Unzip the wrapper zip file, and do the following:
copy WRAPPER_HOME\bin\Wrapper.exe %JBOSS_HOME%\bin\Wrapper.exe
copy WRAPPER_HOME\lib\Wrapper.DLL %JBOSS_HOME%\lib\Wrapper.DLL
copy WRAPPER_HOME\lib\wrapper.jar %JBOSS_HOME%\lib\wrapper.jar
mkdir %JBOSS_HOME%\server\YOURCONFIG\wrapper
Create a wrapper.conf file inside the %JBOSS_HOME%\server\YOURCONFIG\wrapper directory, with the below contents:
wrapper.java.command=D:/Java/jdk1.5.0_14/bin/java
	
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
	
wrapper.java.classpath.1=%JBOSS_HOME%/lib/wrapper.jar
wrapper.java.classpath.2=%JAVA_HOME%/bin/java/lib/tools.jar
wrapper.java.classpath.3=./run.jar
	
wrapper.java.library.path.1=%JBOSS_HOME%/lib
	
# these are the JAVA_OPTS
wrapper.java.additional.1=-server
# enviroment variables - define the ones that match your desired environment
wrapper.java.additional.2=-Denviromnment.variable=value
# memory parameters - define the ones that match your desired environment
wrapper.java.additional.3=-Xms64m
wrapper.java.additional.4=-Xmx96m
# If you need serialization suppport 
wrapper.java.additional.5=-Dsession.serialization.jboss=true
	
wrapper.app.parameter.1=org.jboss.Main
# Parameters to be passed to the application (Jboss) 
# Define server name (configuration) - If you need a config that is different than the "default" or need to run multiple configs
wrapper.app.parameter.2=-c YOURCONFIG
# Define listening IP - If you have more than one IP or want to indicate to listen on a specific IP
wrapper.app.parameter.3=-b aaa.bbb.ccc.ddd
# wrapper log location
wrapper.logfile=%JBOSS_HOME%/server/YOURCONFIG/log/wrapper.log
	
# You must not change below parameters without first uninstall the service
# service name
wrapper.ntservice.name=JbossYOURCONFIG
# service display name
wrapper.ntservice.displayname=JBoss Server YOURCONFIG
The service can be tested by running the following commands:
cd %JBOSS_HOME%\bin\
wrapper.exe -c %JBOSS_HOME%\server\YOURCONFIG\wrapper\wrapper.conf
To now install the service, execute:
cd %JBOSS_HOME%\bin\
wrapper.exe -i %JBOSS_HOME%\server\YOURCONFIG\wrapper\wrapper.conf
If at some point you wish to uninstall the JavaServiceWrapper, execute:
cd %JBOSS_HOME%\bin\
wrapper.exe -r %JBOSS_HOME%\server\YOURCONFIG\wrapper\wrapper.conf

Warning

Make sure your JBOSS_HOME environment variable is set correctly as the wrapper does not set this automatically.
As a final check, make sure that your java-service-wrapper-service.xml file looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
	<mbean code="org.tanukisoftware.wrapper.jmx.WrapperManager"name="JavaServiceWrapper:service=WrapperManager"/>
		
	<mbean code="org.tanukisoftware.wrapper.jmx.WrapperManagerTesting"name="JavaServiceWrapper:service=WrapperManagerTesting"/>
</server>

Note

Using JavaService is no longer a recommended way to run JBoss as a service on Windows.
JavaService has a bug where it will not pass either Xss or XX:ThreadStackStize? arguemnts to the jvm properly. This results are that each thread stack is 1MB. Under load this will most likely fail with an "java.lang.OutOfMemoryError: unable to create new native thread" error. The fix for this error is to lower the thread stack size. Since JavaService does not allow the thread stack size to be set, there will be no solution once an application has run into this error.
The limit on memory allocation can also cause tiles to slow down in JBoss when many applications are deployed.

 
 
  Published under the terms of the Open Publication License Design by Interspire