Google

Locations of visitors to this page

Hosted by:
SourceForge

What is the Java Service Wrapper?
What is the Java Service Wrapper?
Quick Start

As with any application, reading through the documentation the best way to get started. But realizing the desire to get your feet wet quickly, you should glance over this page to get a feel for what the Wrapper can do.

Then to get up and running , at a minimum you will need to read over the Integration Page. There you will be presented with 3 integration methods. From the overviews, choose the one that best meets your needs and then proceed to read over the page dedicated to that integration method.

The Wrapper provides a very large feature set. At some point it is suggested that you look over the full properties list to get a feel for the full power of the Java Service Wrapper.

If you run into problems or have any questions, the preferred method for getting help is posting a message to the wrapper-user mailing list.

Introduction

The Java Service Wrapper is an application which has evolved out of a desire to solve a number of problems common to many Java applications:

Run as a Windows Service or UNIX Daemon

The Wrapper makes it possible to install a Java Application as a Windows NT Service. The scripts provided with the Wrapper also make it very easy to install those same Java Applications as daemon processes on UNIX systems.

The Wrapper correctly handles user log outs under Windows, service dependencies, and the ability to run services which interact with the desktop.

Application Reliability

Application Reliability. As the use of Java expands, applications have been written to provide a variety of mission critical services. These services must be able to provide a high level of reliability. In an ideal world, only software which is 100% bug free will ever be released and installed. However, history has shown this not to be the case. Almost every application suffers from quality issues at one point or another during their life-cycle. Applications hang, crash, run out of memory or suffer from any number of problems. Where possible, problems are fixed quickly without significant service outages. There are times, however, when fixing a problem can be prohibitively expensive or impossible to solve in a short time period.

The Wrapper monitors a JVM process and automatically restarts it if it that the JVM has crashed or hung. This process takes just a few seconds once the Wrapper has decided there is a problem. There is also a way to configure the Wrapper to monitor the console output of a JVM and react to certain strings by restarting or shutting down the JVM.

While these features will not make every problem go away, they will help you to sleep easier knowing that if there is a problem, the Wrapper will be there to keep things up and running until you can get into the office to check the logs. Say goodbye to that pager!! (Or as so as not to date myself, that cel phone!)

Standard, Out of the Box Scripting

Write once run everywhere configuration. Java has been marketed as a "Write Once, Run Everywhere" programming language. While this is true for many aspects of an application, the developer is often plagued with having to write complicated, platform specific scripts which are tasked with building up class paths and collecting other system information necessary to launch an application.

The Java Service Wrapper helps to relieve the developer of this task by providing a set of scripts for a wide range of platforms that can be used as is to launch almost any Java Application controlled by the Wrapper.

The Wrapper moves all JVM configuration into a platform independent configuration file. See the integration examples for details.

On Demand Restarts

The Wrapper provides a way for a Java Application to request that its own JVM be restarted. This can be useful in a number of cases. Applications may wish to restart after having had their configuration files modified. Or the application may simply need to be restarted to avoid problems with a memory or resource leak of some kind.

JVM restarts can be triggered from within the JVM by making a call to WrapperManager.restart(). See the Javadocs for more details.

There are also more passive ways to trigger restarts. The Wrapper has the ability to monitor console output and trigger shutdowns or restarts whenever certain text is detected.

The Wrapper can also be configured to either restart another JVM instance or shudown normally depending on the exit code returned by a JVM.

Flexible Configuration

The Wrapper provides a wide range of configuration properties which can be used to configure the JVM in any way possible from the command line. The Wrapper configuration file also provides a number of properties to allow you configure things like logging and how the Wrapper is installed as a service.

See the Configuration Properties section for details on what is possible. Be sure you have read over the integration section before jumping into the configuration file.

Ease Application Installations

By using the Wrapper's standard scripts, and relative paths in the configuration file, it is usually possible to create an application which requires no further installation than simply expanding an archive file into a directory of the user's choice.

Logging

While the Wrapper does not attempt to, nor should it, replace any of the great logging tools available, it does provide a number of properties to configure how stdout and stderr output to the JVM console is handled. This output can be logged to any combination of the console, a file, or the Event Log (Windows) or syslog (UNIX).

Logging the output to the JVM console can be critical to tracking down problems with an application. Without the Wrapper, when a JVM is being run as a service under Windows, or as a daemon under UNIX, the console output would normally be lost. The Wrapper makes sure that all console output is logged.

Java-based logging tools are only capable of logging output generated from within the JVM. If the JVM crashes or prints out low level messages such as thread dumps, there is normally no way to log it. The Wrapper logs all console output from the JVM process regardless of its source meaning that a record of any crash will survive even after the Wrapper has restarted the JVM.

See the Logging Configuration section for further details.

Supported JVMs

The Wrapper is known to work with the Sun, IBM, Blackdown and BEA WebLogic JRockit JVMs without any problems. If you get a chance to test any other JVMs, please be sure and let us know the results.

NOTE

The Wrapper can be used with 1.2.x versions however some functions are disabled due to this version of Java's lack of support for shutdown hooks. Shutdown hooks were implemented with the 1.3.0 release of Java.

Supported Platforms

Binary distributions are provided for the following list of platforms and are available on the download page.

Only OS versions which are known to work have been listed. If you have had successful or unsuccessful results running on other OS versions, please post a comment below and it will be added to the list.

It should be fairly easy to build the Wrapper from source on additional UNIX platforms. Please let us know and we will update the list.

  • aix - AIX

  • freebsd - FreeBSD

  • hpux, hpux64 - HP-UX, 32 and 64-bit versions.

  • irix - SGI Irix

  • linux - Linux kernels; 2.2.x 2.4.x, 2.6.x. Known to work with Debian and Red Hat, but should work with any distribution. Currently supported on both 32 and 64-bit x86, and 64-bit ppc systems.

  • macosx - Macintosh OS X.

  • osf1 - DEC OSF1.

  • solaris - Sun OS, Solaris 7, 8, 9 and 10. Currently supported on both 32 and 64-bit sparc, and x86 systems.

  • win32 - Windows NT, 2000, XP, and 2003.

    Also known to run on Windows 98 and ME, however due the lack of support for services in the OS, the Wrapper can only be run in console mode.



User Comments

If you notice something that is incorrect, missing, or simply feel that some part of this page could be explained better, feel free to log in and add a comment. You will need to register before you can log on.

Email:
Password:
by Rich Wise (2008/03/05 03:25:42 JST from 195.53.128.4)
Gravatar

I get the following error when starting the wrapper

--> Wrapper Started as Service
STATUS | wrapper | 2008/03/04 13:08:55 | Launching a JVM...
INFO | jvm 1 | 2008/03/04 13:08:56 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2008/03/04 13:08:56 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 1 | 2008/03/04 13:08:56 |
INFO | jvm 1 | 2008/03/04 13:08:56 | WrapperStartStopApp: Unable to locate the class org.apache.geronimo.system.main.Daemon: java.lang.ClassNotFoundException: org.apache.geronimo.system.main.Daemon

by Jason c (2008/02/23 07:49:25 JST from 63.215.122.7)
Gravatar

I get the following error when starting my App, but only when I use the wrapper:

INFO | jvm 1 | 2008/02/22 16:39:43 | INFO Status - Success on initialize of AcctScrThread-0
INFO | jvm 1 | 2008/02/22 16:39:43 | java.lang.IllegalArgumentException: InputStream cannot be null
INFO | jvm 1 | 2008/02/22 16:39:43 | at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:72)
INFO | jvm 1 | 2008/02/22 16:39:43 | at com.ncr.teradata.jtdgss.TdgssParseXml.parse(DashoA13*..)

The parameter's I am passing as:

wrapper.app.parameter.1=com.test.pcu.server.PCUEngine
wrapper.app.parameter.2=PISTON
wrapper.app.parameter.3=ROD

The Main statement is:

public static void main(java.lang.String[] args)

with logic to handle the strings depending upon what is passed in.

Any help would be great. Thanks!

by Leif Mortenson (2008/01/09 21:32:06 JST from 192.168.11.145)
Gravatar

Iratxe,
Windows services do not have access to mapped network drives in most cases, this is a general problem with services and not specific to the Wrapper. Try using the universal path directly: \hostpath

by Iratxe (2008/01/09 20:06:44 JST from 213.4.27.212)
Gravatar

Hello,
I want to read a file which is placed in a network filesystem (Z:). When I execute this program whithout the wrapper it runs ok and is able to read this file. But when I use the wrapper, the program doesn't detect this mapped unit, it only detects the local filesystem (c:). The wrapper log file displays the following exception: File not found exception.
This the code I have implemented:

File roots[]=File.listRoots();
for (int i=0; i < roots.length; i++)
{
File f1=roots[i];
System.out.println(f1.getPath())
}

At this moment, we are deploying the application in the customer site and we need a quick answer. Which options do we have?

Thanks in advance,

Iratxe

by Nanaji (2008/01/04 14:58:38 JST from 203.118.31.122)
Gravatar

This is the best software i have never seen. really awesome.
Really appreciate the developers who are involved. Good work.

by Michelle Hoang (2007/11/15 05:04:54 JST from 130.76.64.93)
Gravatar

I would like to be able to make a build from scatch. Please advice how I would do that (ie. loaded software and version). I need to have the built product run on Windows 2003 server.

by Zacchaeus Sim (2007/10/24 11:40:58 JST from 202.148.160.27)
Gravatar

Environment -
JVM - jrockit-R27.3.1-jdk1.6.0_01 64bit
OS - windows 2003 server

WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.The file is located on the path at the following location butcould not be loaded:

Is there a 64bit version for the wrapper.dll?

by Joel Jensen (2007/09/19 00:11:17 JST from 66.239.1.194)
Gravatar

Some more Vista notes-- It doesn't seem to work for me when I have my account set up with no password. The way to get the service to run and have file permissions, etc was to go to Control Panel -> Administrator Tools -> Services, find your service, right click and go to "Properties", click the "Log On" tab, and select "This account:" and put in your own username and password. This just won't work for blank passwords, it seems. The "runas /user:" didn't work with a blank password either.

After this everything seems to run smoothly.. Not sure if the service can interact with your desktop when logged in this way. Mine doesn't need to, luckily.

by Jos (2007/09/14 00:13:37 JST from 213.223.202.18)
Gravatar

Hi

Just to say that i've succesfully build the wrapper (version 3.2.3) on Irix and Linux IA64 platforms.
For irix, i needed to add pthread library for linking the C part:

wrapper: $(wrapper_OBJECTS)
$(COMPILE) $(wrapper_OBJECTS) -o $(BIN)/wrapper -lm -lpthread

By the way, on binary download page, architecture said for the x86_64 binaries is not correct: it's saying IA64 but the correct architecture is AMD64

by mike (2007/09/06 11:30:23 JST from 151.201.104.126)
Gravatar

This looks like a great product, and exactly what I need. But I have been reading over the documentation for several hours and I am still not clear how product works overall or how I can use it. A good overview with some architecture diagrams, explanation of control flow, etc would be really useful.

by saran (2007/08/07 16:46:11 JST from 203.199.211.109)
Gravatar

hi,

I've tested the wrapper with vista, its working fine but the splash screen is not working which is launched from my application.Please guide me.

Thanks,
Saran

by Graeme Harker (2007/08/04 07:24:44 JST from 77.68.16.117)
Gravatar

If you try to install a JSW service wrapper on Vista, you will get a "OpenSCManager Failed - Access is Denied. (0x5)" error. On Vista, it's not enough to be in the Administrators group, you need to either be actually logged on as the Administrator or you need to run Install.bat with runas/user:Administrator.

by Eddy (2007/07/31 03:08:51 JST from 64.168.56.130)
Gravatar

I've tested the wrapper with Jboss vs running JBoss as a console. OSis windows 2003.
When JBoss runs as console, with more activity, the memory usage goes up, as seen in task manager, then goes down. Variable over the day depending on activity.
I found out that with the wrapper, when memory usage goes up, it stays that way, even thought it should have gone down as with console. Am I missing a config on wrapper?

by John Zaleski (2007/06/29 02:53:31 JST from 199.21.28.13)
Gravatar

We are in the process of evaluating the service wrapper as an approved offering for software development. Several questions that must be answered before our corporate organization "sanctions" the use of the product are as follows. Would it be possible to obtain a response to these? We are considering its use as part of a medical device offering and have found it to be an extremely reliable and simple tool.

a. Project vitality
b. Number of developers
c. Community size
d. Responsiveness
e. Quality of responses
f. Mailing lists
g. Bug tracking
h. Release process

Thanks in advance. My own opinion as to vitality and responsiveness is "very good". However, I lack data on size of community and development staff, etc.

J. Zaleski

by Airen (2007/06/22 04:19:38 JST from 200.55.161.60)
Gravatar

I think it's a great tool the java service wrapper. I used to register a service during the installation of an application I developed. It's the best tool I have found for this. Simple and free.

by Diego Campos (2007/06/05 01:19:37 JST from 200.80.178.20)
Gravatar

Hi,
How I can launch a jnlp app using the wrapper ??

by Graeme Harker (2007/05/20 04:52:58 JST from 77.68.16.117)
Gravatar

A mention of how you would go about monitoring Wrapper processes using a Wrapper that runs jstatd would be useful.

by Leif Mortenson (2007/05/03 23:24:16 JST from 192.168.11.129)
Gravatar

Huub,
Irix builds were being done by a user. Unfortunately they are no longer able to help out. The make files should still work fine. Try downloading the "pre-release" distribution and running "./build32.sh release".

Cheers,
Leif

by Huub van de Mortel (2007/05/01 22:08:23 JST from 130.37.210.210)
Gravatar

I'm missing the SGI Irix version on the download page !! have you dropped IRIX support as so many others ??

by David Levine (2007/03/23 21:07:32 JST from 206.166.143.126)
Gravatar

I can see that there is no binary distribution for 64-bit Windows available as of yet so my question is can I get windows 64-bit support by building it from the source distribution (saw a comment in the 3.2.2 release notes indicating that it might work)?

by Shan (2006/12/13 02:45:14 JST from 64.81.19.194)
Gravatar

Hi Leif,

Is there a wrapper for windows 64-bit platform?

Thanks,
Shan

by Senthil (2006/11/20 22:44:14 JST from 203.193.155.110)
Gravatar

Hi,

Please add support for Windows Vista beta.
It's not the usual "win32" for Vista, it's something else.

Cheers,
Senthil

by Leif Mortenson (2006/09/25 21:31:17 JST from 192.168.11.20)
Gravatar

Amjad,
As of version 3.0.0, the correct package name is org.tanukisoftware.wrapper.* The class names are all the same but there have been many new features added. These were deprecations of the old Wrapper classes and have nothing to do with the JVM you are using.

Cheers,
Leif

by Amjad (2006/09/25 17:37:20 JST from 210.18.76.126)
Gravatar

Hi,
The following classes have been depricated in JVM 1.5 version.
com.silveregg.wrapper.WrapperListener
com.silveregg.wrapper.WrapperManager

Please let me know what are the alternate classes.

Best Regards,
Amjad

by David Perez (2004/11/23 20:21:31 JST from 80.58.34.172)
Gravatar

Even though wrapper.conf looks like a property file, it must be warned that escapes aren't supported unlike a real Java property file. In my case I read wrapper.conf by using Properties.load() and have problems if a backslash is present in the file.

by Sam Brljak (2004/05/04 10:25:19 JST from 155.144.251.120)
Gravatar

Hi

in the "integration methods" section, it describes three methods of integrating java service wrapper. The 3rd method provides the most flexibility and access to all of the wrapper's features. What is not clear is what features specifically would I be forsaking if I chose method 2 over method 3.

Your feedback on this would be greatly appreciated.

Thanks
Sam

last modified: