当前位置: 代码迷 >> J2EE >> java service wrapper 实现在linux上jar用 service启动 用过高手的来 急(急(急(()
  详细解决方案

java service wrapper 实现在linux上jar用 service启动 用过高手的来 急(急(急(()

热度:78   发布时间:2016-04-22 00:57:38.0
java service wrapper 实现在linux下jar用 service启动 用过高手的来 急!急!(急!(急!((在线等)
配置文件wrapper.conf如下
Wrapper Properties
#********************************************************************
# Java Application
set.JAVA_HOME=$JAVA_HOME
wrapper.java.command=$JAVA_HOME/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=../lib/wrappertest.jar
wrapper.java.classpath.3=../bin/log4j-1.2.8.jar
wrapper.java.classpath.4=../bin/.
wrapper.java.classpath.5=../bin/onlineupdate.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib

# Java Additional Parameters
#wrapper.java.additional.1=

# 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=com.necst.webapfw.onlineclient.ProcessMain
....


我在 service Appserver start的时候
提示错误是这样的
Unable to locate any of the following binaries:
  /etc/rc.d/init.d/./wrapper-linux-x86-32
  /etc/rc.d/init.d/./wrapper-linux-x86-64
  /etc/rc.d/init.d/./wrapper


------解决方案--------------------
写服务可以直接调用.sh 脚本,比如
Java code
/usr/java/jdk/bin/java -XmsMem256m -Xmx512m org.tanukisoftware.wrapper.WrapperSimpleApp
  相关解决方案