随笔 - 3, 文章 - 1, 评论 - 0, 引用 - 0
数据加载中……

让JBoss变成Windows的服务!

http://javaservice.objectweb.org/
Example (JBoss 3.0)

The JBoss server software provides a Java run-time environment that can be used for JSP and J2EE applications. In this use, it often needs to be run as a Windows NT System Service, for which the JavaService utility is designed. Depending on configuration, JBoss may require that an associated database server is already running, which should be set up as a Windows NT Service dependency, with the example below set up against the MySql database. {JDK_HOME} is the location of your JDK and {JBOSS_BIN} is the location of your JBoss binaries installation. These instructions are based on information in the JBoss 3.0 quick-start guide, but are in any case provided 'as is'.

  1. Copy the JavaService.exe file into the {JBOSS_BIN} directory as JBossService.exe.
  2. Start a command prompt and change to the directory {JBOSS_BIN}.
  3. Run the following command:
    JBossService.exe -install JBoss
    {JDK_HOME}\jre\bin\{hotspot|server|classic}\jvm.dll
    -Djava.class.path={JDK_HOME}\lib\tools.jar;{JBOSS_BIN}\run.jar
    -start org.jboss.Main
    -stop org.jboss.Main -method systemExit
    -out {JBOSS_BIN}\stdout.log
    -err {JBOSS_BIN}\stderr.log
    -current {JBOSS_BIN}
    -depends mysql
    -manual
    -overwrite
    -startup 10
  4. To remove the registered service, run the following command from the same directory:
    JBossService.exe -uninstall JBoss

The JBoss service can then be started by issuing the following command, which will also start the MySql service beforehand if it is not already running:
net start jboss

The service can then be stopped by issuing the following command:
net stop jboss

posted on 2006-01-15 00:58 汉尼 阅读(699) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: