概述
如何将Jetty 运行为win32服务,不用每次运行一个Dos程序,可以象其他服务一样开机自动启动。
1设置wrapper.conf,如果需要用到一些jar文件需要在wrapper.java.classpath中配置,如Oracle数据库JDBC连接库
2运行<Jetty_home>extrawin32Wrapper.exe,添加Win32服务
wrapper.conf内容如下
#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=C:/Java/jdk1.5.0_01/bin/java
# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=../../start.jar
#Oracle JDBC 数据库连接
wrapper.java.classpath.3=lib/classes12.jar
wrapper.java.classpath.4=lib/nls_charset12.jar
wrapper.java.classpath.5=lib/ocrs12.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=lib
# Java Additional Parameters
wrapper.java.additional.1=-Djetty.home=../..
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=3
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=64
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=org.mortbay.start.Main
wrapper.app.parameter.2=../../etc/admin.xml
wrapper.app.parameter.3=../../etc/jetty.xml
#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console. (See docs for formats)
wrapper.console.format=PM
# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO
# Log file to use for wrapper output logging.
wrapper.logfile=../../logs/wrapper.log
# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=LPTM
# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO
# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0
# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0
# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE
#********************************************************************
# Wrapper NT Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
# using this configuration file has been installed as a service.
# Please uninstall the service before modifying this section. The
# service can then be reinstalled.
# Name of the service
wrapper.ntservice.name=Jetty
# Display name of the service
wrapper.ntservice.displayname=Jetty
# Description of the service
wrapper.ntservice.description=Jetty app server
# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=
# Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START
# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false
最后
以上就是畅快巨人为你收集整理的如何将Jetty 运行为win32服务的全部内容,希望文章能够帮你解决如何将Jetty 运行为win32服务所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复