JBoss As Windows Service in Windows

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

11/27/2015 Red 

Hat Customer Portal

C USTO ME R PO RTAL

English
Support  Product Documentation  JBoss Enterprise Application Platform  4.2  Getting Started Guide Formats

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 (http://labs.jboss.com/jbossweb/downloads/). 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 (http://wrapper.tanukisoftware.org/doc/english/integrate­simple­win.html) and
manage it using the JMX (http://wrapper.tanukisoftware.org/doc/english/jmx.html#jboss).

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:

https://access.redhat.com/documentation/en­US/JBoss_Enterprise_Application_Platform/4.2/html/Getting_Started_Guide/Starting_and_Stopping_the_Server­Running_as_a_Service_under_Microsoft_Windows.html 1/2
11/27/2015 Red Hat Customer Portal

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
automaticly.

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 (http://wiki.jboss.org/auth/wiki/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.

Privacy Policy (http://www.redhat.com/en/about/privacy-policy) Customer Portal Terms of Use (https://access.redhat.com/help/terms/)


All Policies and Guidelines (http://www.redhat.com/en/about/all-policies-guidelines)
Copyright © 2015 Red Hat, Inc.

https://access.redhat.com/documentation/en­US/JBoss_Enterprise_Application_Platform/4.2/html/Getting_Started_Guide/Starting_and_Stopping_the_Server­Running_as_a_Service_under_Microsoft_Windows.html 2/2

You might also like