7 Replies Latest reply on Feb 24, 2003 8:54 AM by terp

    Running JBoss as Service

    andrewrcollins

       

      "andrewrcollins" wrote:
      Using the new "Java Service Wrapper" available at:

      http://wrapper.sourceforge.net/doc/english/index.html

      Attached is a zip of files in new top-level
      service directory of JBoss installations.

      install.bat - Install service
      remove.bat - Remove service
      jboss.conf - Service configuration

      start.bat - Start service
      stop.bat - Stop service

      Wrapper.exe - Java Service Wrapper file
      wrapper.jar - Java Service Wrapper file
      Wrapper.dll - Java Service Wrapper file


        • 1. Re: Running JBoss as Service
          erikture

          Hello!

          I am trying to use the Java Service Wrapper to start JBoss together with Jetty. The service starts fine but when accessing for example the jmx-console I will receive the following error.

          INFO | jvm 1 | 2003/01/08 10:51:05 | 10:51:05,586 WARN [jbossweb] WARNING: Exception for /jmx-console/
          INFO | jvm 1 | 2003/01/08 10:51:05 | java.lang.NullPointerException
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.util.FileUtils.resolveFile(FileUtils.java:330)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.Project.resolveFile(Project.java:618)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.types.Path.resolveFile(Path.java:451)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.types.Path.translatePath(Path.java:353)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.types.Path$PathElement.setPath(Path.java:119)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.tools.ant.types.Path.setPath(Path.java:167)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:262)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:216)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:151)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.Default.handleGet(Default.java:232)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.Default.service(Default.java:146)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpServer.service(HttpServer.java:875)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.jboss.jetty.Jetty.service(Jetty.java:543)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
          INFO | jvm 1 | 2003/01/08 10:51:05 | at java.lang.Thread.run(Thread.java:479)

          Why?

          Erik

          • 2. Re: Running JBoss as Service
            erikture

            Hello again!

            I have found out that my problem is caused by Jetty accessing the System.getProperty("java.class.path"); method and when that is returning null I will receive the stacktrace below. The java.class.path property is set when starting jboss through the run.bat script but not when starting it as a service.

            Is it possible to get it set using the wrapper?
            Maybee the fault is Jettys, should it crash when it is not set?


            NFO | jvm 1 | 2003/01/08 14:04:40 | java.lang.NullPointerException
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.util.FileUtils.resolveFile(FileUtils.java:330)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.Project.resolveFile(Project.java:618)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.types.Path.resolveFile(Path.java:451)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.types.Path.translatePath(Path.java:353)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.types.Path$PathElement.setPath(Path.java:119)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.tools.ant.types.Path.setPath(Path.java:167)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:262)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:216)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:151)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.Default.handleGet(Default.java:232)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.Default.service(Default.java:146)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpServer.service(HttpServer.java:875)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.jboss.jetty.Jetty.service(Jetty.java:543)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
            INFO | jvm 1 | 2003/01/08 14:04:40 | at java.lang.Thread.run(Thread.java:479)

            /Erik

            • 3. Re: Running JBoss as Service
              erikture

              Hello!

              I have found out that you have to specify the absolute paths when defining the classpaths.

              This works:

              # Java Classpath (include wrapper.jar) Add class path elements as
              # needed starting from 1
              wrapper.java.classpath.1=%JBOSS_HOME%/service/wrapper.jar
              wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar
              wrapper.java.classpath.3=%JBOSS_HOME%/bin/run.jar
              wrapper.java.classpath.4=%JBOSS_HOME%/bin/shutdown.jar

              but not this:

              # Java Classpath (include wrapper.jar) Add class path elements as
              # needed starting from 1
              wrapper.java.classpath.1=./wrapper.jar
              wrapper.java.classpath.2=%JAVA_HOME%/lib/tools.jar
              wrapper.java.classpath.3=../bin/run.jar
              wrapper.java.classpath.4=../bin/shutdown.jar

              /Erik

              • 4. Re: Running JBoss as Service
                mrnatural

                Appreciate the hedzup on the absolute paths.

                Used install.bat to install the service successfully but the service starts and then immediately dies. I've got a legit log directory for the wrapper.logfile. Only content in logfile shown below:

                STATUS | wrapper | 2003/02/06 21:29:40 | JBoss AppServer installed.

                Any ideas?
                Thx!
                MrN

                • 5. Re: Running JBoss as Service
                  mrnatural

                  Forgot to say that this 'anmoaly' was noted using 3.0.4 on XP/Pro

                  Also... starting service from mgt console results in:

                  "The JBoss AppServer service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."

                  • 6. Re: Running JBoss as Service
                    mrnatural

                    2hrs l8r, setting log level to debug was able to see the params being passed to the jvm. Noted that what was supposed to be %JBOSS_HOME%/service/wrapper.jar was appearing as JBOSS_HOME/service/wrapper.jar...

                    fixed that brain fart and now service starts/stops as expected...

                    Sorry to have paraded my ignorance in this thread..
                    <lame excuse> (total experience with JBoss < 3hr total as of this post). </lame excuse>

                    Promise next time will thrash 2wice as long before asking for dustoff.

                    Question now is how to pass -c all argument to the JBoss service through the wrapper?

                    Now back to your regularly scheduled thread..

                    -MrN

                    • 7. Re: Running JBoss as Service
                      terp

                      Hi,

                      I have used JavaService for a long time without problems. Currently i am running 3.0.3 and 3.0.6 as a service using JavaService. So I thought i would be a no brainer to install 3.2.0RC2 as a service as well... This wasnt so :-(

                      I have tried with both the service wrapper and JavaService, both fail. I can see in boot.log that they fail because the jars in jboss/lib and jboss/server/default/lib are not visible. This have never been a problem with earlier version of jBoss.

                      So my question is, have anybody installed 3.2.0RC2 as a service without the above problem?

                      Thanks...

                      BR
                      Torsten