1 Reply Latest reply on Dec 28, 2003 12:14 PM by Alan Moor

    Starting JBoss as a Service using a Wrapper

    sharksnack Newbie

      Is anyone familiar with setting up JBoss to run as a service under WinXP? I am currently trying to get this working using a Wrapper as mentioned in some other threads. I have followed the directions as listed on this page: http://wrapper.tanukisoftware.org/doc/english/integrate-simple-win.html

      When I go through the setup and try to run the app I get the following log file:

      STATUS | wrapper | 2003/12/04 16:32:47 | --> Wrapper Started as Console
      STATUS | wrapper | 2003/12/04 16:32:48 | Launching a JVM...
      INFO | jvm 1 | 2003/12/04 16:32:48 | WrapperSimpleApp Usage:
      INFO | jvm 1 | 2003/12/04 16:32:48 | java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_parameters]
      INFO | jvm 1 | 2003/12/04 16:32:48 |
      INFO | jvm 1 | 2003/12/04 16:32:48 | Where:
      INFO | jvm 1 | 2003/12/04 16:32:48 | app_class: The fully qualified class name of the application to run.
      INFO | jvm 1 | 2003/12/04 16:32:48 | app_parameters: The parameters that would normally be passed to the
      INFO | jvm 1 | 2003/12/04 16:32:48 | application.
      STATUS | wrapper | 2003/12/04 16:32:50 | <-- Wrapper Stopped


      With the last line stating "Wrapper Stopped", I am assuming the the service is no longer running. In fact, JBoss does not seem to be running.

      Here is the wrapper.conf file I am using:

      #********************************************************************
      # Wrapper Properties
      #********************************************************************
      # Java Application
      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=%JAVA_HOME%/lib/tools.jar
      wrapper.java.classpath.3=./run.jar

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

      # Java Additional Parameters
      #wrapper.java.additional.1=-Dprogram.name=run.bat

      # 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.jboss.Main

      #********************************************************************
      # 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=JBoss

      # Display name of the service
      wrapper.ntservice.displayname=JBoss Application Server

      # Description of the service
      wrapper.ntservice.description=JBoss Application 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




      Thanks,
      SharkSnack

        • 1. Re: Starting JBoss as a Service using a Wrapper
          Alan Moor Newbie

          Man, that's the long way 'round. I am currently successfully, stably, running the JBoss/Tomcat stack as a service using a product called FireDaemon. It is a very nice service manager that is free for personal use and extremely cheap for production use. See http://www.firedaemon.com. Basically, it runs JBoss' run.bat, so all your configuration happens there, not in a separate product. It's got a nice GUI interface to manage the service definition. Couldn't be easier.

          One gotcha though. When you run a jvm as a Service under Microsoft, you will randomly receive shutdown signals from the OS (thanks Bill). So, if you are running Sun's HotSpot JVM, be sure to include -Xrs in your JAVA_OPTS in run.bat. If you don't, JBoss will occasionally shut down of its own accord. All you will see is a log message that "LifeThread is ending!" and a graceful shutdown. Damned annoying. The only down side is that you should use shutdown.bat to stop JBoss, rather than stopping the service. Stopping the service will kill JBoss without giving it a chance to tidy up. If you set FireDaemon to "Terminate FireDaemon" on program shutdown (see Settings tab), using shutdown.bat will stop the service as well. Pretty cool.

          Cheers and good luck,
          Alan Moor
          http://www.rossgroupinc.com