Java Service Wrapper配置详解
1 #encoding=UTF-8 2 # Configuration files must begin with a line specifying the encoding 3 # of the the file. 4 5 #******************************************************************** 6 # Wrapper License Properties (Ignored by Community Edition) 7 #******************************************************************** 8 # Professional and Standard Editions of the Wrapper require a valid 9 # License Key to start. Licenses can be purchased or a trial license 10 # requested on the following pages: 11 # http://wrapper.tanukisoftware.com/purchase 12 # http://wrapper.tanukisoftware.com/trial 13 14 # Include file problems can be debugged by removing the first '#' 15 # from the following line: 16 ##include.debug 17 18 # The Wrapper will look for either of the following optional files for a 19 # valid License Key. License Key properties can optionally be included 20 # directly in this configuration file. 21 #include ../conf/wrapper-license.conf 22 #include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf 23 24 # The following property will output information about which License Key(s) 25 # are being found, and can aid in resolving any licensing problems. 26 #wrapper.license.debug=TRUE 27 28 #******************************************************************** 29 # Wrapper Localization 30 #******************************************************************** 31 # Specify the locale which the Wrapper should use. By default the system 32 # locale is used. 33 #wrapper.lang=en_US # en_US or ja_JP 34 35 # Specify the location of the Wrapper's language resources. If these are 36 # missing, the Wrapper will default to the en_US locale. 37 wrapper.lang.folder=../lang 38 39 #******************************************************************** 40 # Wrapper Java Properties 41 #******************************************************************** 42 # Java Application 43 # Locate the java binary on the system PATH: 44 wrapper.java.command=java 45 # Specify a specific java binary: 46 #set.JAVA_HOME=/java/path 47 #wrapper.java.command=%JAVA_HOME%/bin/java 48 49 # Tell the Wrapper to log the full generated Java command line. 50 #wrapper.java.command.loglevel=INFO 51 52 # Java Main class. This class must implement the WrapperListener interface 53 # or guarantee that the WrapperManager class is initialized. Helper 54 # classes are provided to do this for you. See the Integration section 55 # of the documentation for details. 56 wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp 57 58 # Java Classpath (include wrapper.jar) Add class path elements as 59 # needed starting from 1 60 61 wrapper.java.classpath.1=../lib/wrapper.jar 62 wrapper.java.classpath.2=../application/TestService.jar 63 64 65 # Java Library Path (location of Wrapper.DLL or libwrapper.so) 66 wrapper.java.library.path.1=../lib 67 68 # Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode. 69 wrapper.java.additional.auto_bits=TRUE 70 71 # Java Additional Parameters 72 wrapper.java.additional.1= 73 74 # Initial Java Heap Size (in MB) 75 #wrapper.java.initmemory=3 76 77 # Maximum Java Heap Size (in MB) 78 #wrapper.java.maxmemory=64 79 80 # Application parameters. Add parameters as needed starting from 1 81 wrapper.app.parameter.1=fs.HelloWorld 82 83 #******************************************************************** 84 # Wrapper Logging Properties 85 #******************************************************************** 86 # Enables Debug output from the Wrapper. 87 # wrapper.debug=TRUE 88 89 # Format of output for the console. (See docs for formats) 90 wrapper.console.format=PM 91 92 # Log Level for console output. (See docs for log levels) 93 wrapper.console.loglevel=INFO 94 95 # Log file to use for wrapper output logging. 96 wrapper.logfile=../logs/wrapper.log 97 98 # Format of output for the log file. (See docs for formats) 99 wrapper.logfile.format=LPTM 100 101 # Log Level for log file output. (See docs for log levels) 102 wrapper.logfile.loglevel=INFO 103 104 # Maximum size that the log file will be allowed to grow to before 105 # the log is rolled. Size is specified in bytes. The default value 106 # of 0, disables log rolling. May abbreviate with the 'k' (kb) or 107 # 'm' (mb) suffix. For example: 10m = 10 megabytes. 108 wrapper.logfile.maxsize=0 109 110 # Maximum number of rolled log files which will be allowed before old 111 # files are deleted. The default value of 0 implies no limit. 112 wrapper.logfile.maxfiles=0 113 114 # Log Level for sys/event log output. (See docs for log levels) 115 wrapper.syslog.loglevel=NONE 116 117 #******************************************************************** 118 # Wrapper General Properties 119 #******************************************************************** 120 # Allow for the use of non-contiguous numbered properties 121 wrapper.ignore_sequence_gaps=TRUE 122 123 # Do not start if the pid file already exists. 124 wrapper.pidfile.strict=TRUE 125 126 # Title to use when running as a console 127 wrapper.console.title=Test Wrapper Sample Application 128 129 #******************************************************************** 130 # Wrapper JVM Checks 131 #******************************************************************** 132 # Detect DeadLocked Threads in the JVM. (Requires Standard Edition) 133 wrapper.check.deadlock=TRUE 134 wrapper.check.deadlock.interval=10 135 wrapper.check.deadlock.action=RESTART 136 wrapper.check.deadlock.output=FULL 137 138 # Out Of Memory detection. 139 # (Ignore output from dumping the configuration to the console. This is only needed by the TestWrapper sample application.) 140 wrapper.filter.trigger.999=wrapper.filter.trigger.*java.lang.OutOfMemoryError 141 wrapper.filter.allow_wildcards.999=TRUE 142 wrapper.filter.action.999=NONE 143 # Ignore -verbose:class output to avoid false positives. 144 wrapper.filter.trigger.1000=[Loaded java.lang.OutOfMemoryError 145 wrapper.filter.action.1000=NONE 146 # (Simple match) 147 wrapper.filter.trigger.1001=java.lang.OutOfMemoryError 148 # (Only match text in stack traces if -XX:+PrintClassHistogram is being used.) 149 #wrapper.filter.trigger.1001=Exception in thread "*" java.lang.OutOfMemoryError 150 #wrapper.filter.allow_wildcards.1001=TRUE 151 wrapper.filter.action.1001=RESTART 152 wrapper.filter.message.1001=The JVM has run out of memory. 153 154 #******************************************************************** 155 # Wrapper Email Notifications. (Requires Professional Edition) 156 #******************************************************************** 157 # Common Event Email settings. 158 #wrapper.event.default.email.debug=TRUE 159 #wrapper.event.default.email.smtp.host=<SMTP_Host> 160 #wrapper.event.default.email.smtp.port=25 161 #wrapper.event.default.email.subject=[%WRAPPER_HOSTNAME%:%WRAPPER_NAME%:%WRAPPER_EVENT_NAME%] Event Notification 162 #wrapper.event.default.email.sender=<Sender email> 163 #wrapper.event.default.email.recipient=<Recipient email> 164 165 # Configure the log attached to event emails. 166 #wrapper.event.default.email.attach_log=TRUE 167 #wrapper.event.default.email.maillog.lines=50 168 #wrapper.event.default.email.maillog.format=LPTM 169 #wrapper.event.default.email.maillog.loglevel=INFO 170 171 # Enable specific event emails. 172 #wrapper.event.wrapper_start.email=TRUE 173 #wrapper.event.jvm_prelaunch.email=TRUE 174 #wrapper.event.jvm_start.email=TRUE 175 #wrapper.event.jvm_started.email=TRUE 176 #wrapper.event.jvm_deadlock.email=TRUE 177 #wrapper.event.jvm_stop.email=TRUE 178 #wrapper.event.jvm_stopped.email=TRUE 179 #wrapper.event.jvm_restart.email=TRUE 180 #wrapper.event.jvm_failed_invocation.email=TRUE 181 #wrapper.event.jvm_max_failed_invocations.email=TRUE 182 #wrapper.event.jvm_kill.email=TRUE 183 #wrapper.event.jvm_killed.email=TRUE 184 #wrapper.event.jvm_unexpected_exit.email=TRUE 185 #wrapper.event.wrapper_stop.email=TRUE 186 187 # Specify custom mail content 188 wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n 189 190 #******************************************************************** 191 # Wrapper Windows NT/2000/XP Service Properties 192 #******************************************************************** 193 # WARNING - Do not modify any of these properties when an application 194 # using this configuration file has been installed as a service. 195 # Please uninstall the service before modifying this section. The 196 # service can then be reinstalled. 197 198 # Name of the service 199 wrapper.name=testwrapper 200 201 # Display name of the service 202 wrapper.displayname=Test Wrapper Sample Application 203 204 # Description of the service 205 wrapper.description=Test Wrapper Sample Application Description 206 207 # Service dependencies. Add dependencies as needed starting from 1 208 wrapper.ntservice.dependency.1= 209 210 # Mode in which the service is installed. AUTO_START, DELAY_START or DEMAND_START 211 wrapper.ntservice.starttype=AUTO_START 212 213 # Allow the service to interact with the desktop. 214 wrapper.ntservice.interactive=false
精简:
1 wrapper.lang.folder=../lang 2 3 wrapper.java.command=java 4 5 wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp 6 7 wrapper.java.classpath.1=../lib/wrapper.jar 8 wrapper.java.classpath.2=../application/TestService.jar 9 10 wrapper.java.library.path.1=../lib 11 12 wrapper.java.additional.auto_bits=TRUE 13 14 wrapper.java.additional.1= 15 16 wrapper.app.parameter.1=fs.HelloWorld 17 18 wrapper.console.format=PM 19 20 wrapper.console.loglevel=INFO 21 22 wrapper.logfile=../logs/wrapper.log 23 24 wrapper.logfile.format=LPTM 25 26 wrapper.logfile.loglevel=INFO 27 28 wrapper.logfile.maxsize=0 29 30 wrapper.logfile.maxfiles=0 31 32 wrapper.syslog.loglevel=NONE 33 34 wrapper.ignore_sequence_gaps=TRUE 35 36 37 wrapper.pidfile.strict=TRUE 38 39 wrapper.console.title=Test Wrapper Sample Application 40 41 42 wrapper.check.deadlock=TRUE 43 wrapper.check.deadlock.interval=10 44 wrapper.check.deadlock.action=RESTART 45 wrapper.check.deadlock.output=FULL 46 47 48 wrapper.filter.trigger.999=wrapper.filter.trigger.*java.lang.OutOfMemoryError 49 wrapper.filter.allow_wildcards.999=TRUE 50 wrapper.filter.action.999=NONE 51 52 wrapper.filter.trigger.1000=[Loaded java.lang.OutOfMemoryError 53 wrapper.filter.action.1000=NONE 54 55 wrapper.filter.trigger.1001=java.lang.OutOfMemoryError 56 57 wrapper.filter.action.1001=RESTART 58 wrapper.filter.message.1001=The JVM has run out of memory. 59 60 wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n 61 62 63 wrapper.name=testwrapper 64 65 wrapper.displayname=Test Wrapper Sample Application 66 67 wrapper.description=Test Wrapper Sample Application Description 68 69 wrapper.ntservice.dependency.1= 70 71 wrapper.ntservice.starttype=AUTO_START 72 73 wrapper.ntservice.interactive=false
关键点:
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=../application/TestService.jar
wrapper.java.additional.1=
wrapper.app.parameter.1=fs.HelloWorld