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

Java Service Wrapper配置详解,布布扣,bubuko.com

时间: 2024-12-22 23:27:44

Java Service Wrapper配置详解的相关文章

JAVA环境变量配置详解

JAVA环境变量JAVA_HOME.CLASSPATH.PATH设置详解 Windows下JAVA用到的环境变量主要有3个,JAVA_HOME.CLASSPATH.PATH. JAVA_HOME 指向的是JDK的安装路径,如C:\jdk1.5.0_06,在这路径下你应该能够找到bin.lib等目录.( 今晚使用的新买的电脑配置不知道怎么的需要加bin才可以在CMD运行,JAVA_HOME=C:\jdk1.5.0_06\bin; 下面的是我Copy网上的资料实践可以使用才写上来的,还要注意JDK和

java web.xml配置详解

1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个ServletContext(servlet上下文),这个web项目的所有部分都将共享这个上下文. 3.容器将<context-param>转换为键值对,并交给servletContext. 4.容器创建<listener>中的类实例,创建监听器. 二  Load-on-startup Load

Java web.xml 配置详解

在项目中总会遇到一些关于加载的优先级问题,近期也同样遇到过类似的,所以自己查找资料总结了下,下面有些是转载其他人的,毕竟人家写的不错,自己也就不重复造轮子了,只是略加点了自己的修饰. 首先可以肯定的是,加载顺序与它们在 web.xml 文件中的先后顺序无关.即不会因为 filter 写在 listener 的前面而会先加载 filter.最终得出的结论是:listener -> filter -> servlet 同时还存在着这样一种配置节:context-param,它用于向 Servlet

Wrapper配置详解及高级应用(转)

转自:http://286.iteye.com/blog/1921414 将一个简单的程度如HelloWorld 的应用包装秤Wrapper 服务并不复杂,甚至可以认为非常简单.但是实际项目应用过程中我们的程序一般较庞大,运行环境也较复杂. 通过Wrapper 配置文件的分析与配置进一步了解构建Wrapper 服务需要注意的关键点及重要部分. 首先,打开conf 文件夹下的wrapper.conf配置文件,此配置文件时Wrapper 的主配置文件也是关键配置文件,下面开始一项一项的开始分析. 1

详解Maven项目利用java service wrapper将Java程序生成Windows服务

在项目的开发中,有时候需要将Java应用程序打包成Windows服务,我们就直接可以通过windows的服务来启动和关闭java程序了. 本博文将通过有两种方法实现该功能,手动创建法和Maven自动打包法. 一. 准备 下载java service wrapper 网址:http://sourceforge.net/projects/wrapper/或http://wrapper.tanukisoftware.com/doc/english/download.jsp 我下载的版本是wrapper

Flex3与java BlazeDS入门教程及其配置详解

原文:Flex3与java BlazeDS入门教程及其配置详解 源代码下载地址:http://www.zuidaima.com/share/1789445387160576.htm BlazeDS的下载和介绍: http://opensource.adobe.com/wiki/display/blazeds/Release+Builds(已经失效) 新的下载路径:http://sourceforge.net/adobe/wiki/Projects/或是http://www.pc6.com/sof

使用Java Service Wrapper在Linux下配置Tomcat应用

前言 Java Service Wrapper是Tanuki Software的一个产品,可以将Java应用注册成Windows或Linux服务,使其可以随系统开机启动,同时可以监控Java应用的状态,使其在出异常状况时自动启动,其具体特性请参考官方文档Overview of Wrapper features ,本文记录了笔者在官方文档指导下在Linux环境下用Java Serivice Wrapper配置Tomcat应用的实践. 前提 Suse Linux 64位 Java 8 Downloa

java log4j基本配置及日志级别配置详解

java log4j日志级别配置详解 1.1 前言 说出来真是丢脸,最近被公司派到客户公司面试外包开发岗位,本来准备了什么redis.rabbitMQ.SSM框架的相关面试题以及自己做过的一些项目回顾,信心满满地去面试,结果别人一上来就问到了最近项目使用的日志系统是什么?日志级别是怎么配置的?当时我都蒙X了,平时都是项目经理搭的,我自己也是随便上网一搜往配置文件一黏贴就OK了.我就这么说完后面试官深深定了我一眼,当时我的内心羞愧到...... 1.2 闲话少说,讲讲日志的发展故事(如果已经了解的

Apache httpd(apache2)服务配置详解,Mac下设置虚拟主机部署多个web项目,及反向代理部署Java项目

Apache httpd服务配置详解 查看版本:httpd -v Server version: Apache/2.4.33 (Unix) Server built:   Apr  3 2018 17:54:07 文件路径:/etc/apache2/httpd.conf # 服务目录(全局配置)用于指定Apache的安装路径,# 此选项参数值在安装Apache时系统会自动把Apache的路径写入ServerRoot "/usr" # 设置互斥对象的目录# Mutex default:/