11 Replies Latest reply on Oct 8, 2002 3:42 PM by Paul

    Error starting JBoss as an MS Win NT service.

    Paul Newbie

      When I start JBoss as a service after using the "JavaService" tool, documented in the Getting Started guide, I get the following error.

      Could not create a FileOutputStream for System.out redirect.

      Any ideas?

        • 1. Re: Error starting JBoss as an MS Win NT service.
          Paul Newbie

          I forgot to say what version of JBoss I was running. I am having this problem on verison 3.0.2.

          • 2. Re: Error starting JBoss as an MS Win NT service.
            Mark Johnson Newbie

            I installed JBoss 3.0.0 this way, I haven't gotten around to 3.0.2 yet, but hopefully this helps. I got the JavaService command to run fine on my machine(win xp) Whn it runs it creates a file called out.txt in the jboss_home directory.

            Make sure that the directory is writable and that if the file already exists it isn't read-only.

            In addition, sometimes services can be wierd if the services window is still an active process on the machine, regardless of the user. Try shutting down all instances of mmc.exe in task mananger then unistalling and reinstalling the service. be aware that mmc.exe is used for other programs besides services, so you may end up shutting down something else by accident.

            I used the follwing JBoss.bat file to install the service:

            @echo off
            if "%1" == "uninstall" goto uninstall
            if "%1" == "-uninstall" goto uninstall
            if "%1" == "" goto usage
            if "%2" == "" goto usage
            if "%3" == "" goto usage
            if "%1" == "-help" goto usage
            if "%1" == "-?" goto usage
            if "%1" == "/?" goto usage
            :install
            JavaService.exe -install JBoss30 %1\jre\bin\%3\jvm.dll -Djava.class.path=%1\lib\tools.jar;%2\bin\run.jar -start org.jboss.Main -stop org.jboss.Main -method systemExit -out %2\bin\out.txt -current %2\bin
            goto eof
            :uninstall
            JavaService.exe -uninstall JBoss30
            goto eof
            :usage
            echo -------- To Install JBoss 3.0 do
            echo Usage: %0 jdk_home jboss_home (classic/hotspot/server)
            echo NOTE: You MAY NOT use spaces in the path names. If you know how
            echo to fix this, please tell me.
            echo JDK 1.3 does not come with hotpot server by default, you must
            echo install this seperately if you wish to use it.
            echo Example: %0 c:\progra~1\jdk c:\progra~1\jboss30 hotspot
            echo --------
            echo -------- To Uninstall JBoss 3.0 do
            echo Usage: %0 uninstall
            echo --------
            goto eof
            :eof

            • 3. Re: Error starting JBoss as an MS Win NT service.
              Mark Johnson Newbie

              I just verified this works with 3.0.2

              • 4. Re: Error starting JBoss as an MS Win NT service.
                Paul Newbie

                I verified write ability to the directory. Also used the script you provied. Now I get a different problem. When manually starting JBoss as a service the JavaService.exe has an abnormal end (my Dr watson cathces it so I don't know what the real error message is.) The odd this is that sometimes when I read the message in the event viewer it tells me JBoss has started, other times the service console throws an error right away. When I don't get an error right away, I look in the service console and it shows started. But when I go to end the service manually I get an error that the service could not be stopped because it was never started.

                Any ideas would be very welome.

                TIA

                • 5. Re: Error starting JBoss as an MS Win NT service.
                  Paul Newbie

                  I verified write ability to the directory. Also used the script you provied. Now I get a different problem. When manually starting JBoss as a service the JavaService.exe has an abnormal end (my Dr watson cathces it so I don't know what the real error message is.) The odd this is that sometimes when I read the message in the event viewer it tells me JBoss has started, other times the service console throws an error right away. When I don't get an error right away, I look in the service console and it shows started. But when I go to end the service manually I get an error that the service could not be stopped because it was never started.

                  Any ideas would be very welome.

                  TIA

                  • 6. Re: Error starting JBoss as an MS Win NT service.
                    Paul Newbie

                    I verified write ability to the directory. Also used the script you provide. Now I get a different problem. When manually starting JBoss as a service the JavaService.exe has an abnormal end (my Dr watson catches it so I don't know what the real error message is.) The odd this is that sometimes when I read the message in the event viewer it tells me JBoss has started, other times the service console throws an error right away. When I don't get an error right away, I look in the service console and it shows started. But when I go to end the service manually I get an error that the service could not be stopped because it was never started.

                    Any ideas would be very welcome.

                    TIA

                    • 7. Re: Error starting JBoss as an MS Win NT service.
                      Paul Newbie

                      I verified write ability to the directory. Also used the script you provied. Now I get a different problem. When manually starting JBoss as a service the JavaService.exe has an abnormal end (my Dr watson cathces it so I don't know what the real error message is.) The odd this is that sometimes when I read the message in the event viewer it tells me JBoss has started, other times the service console throws an error right away. When I don't get an error right away, I look in the service console and it shows started. But when I go to end the service manually I get an error that the service could not be stopped because it was never started.

                      Any ideas would be very welome.

                      TIA

                      • 8. Re: Error starting JBoss as an MS Win NT service.
                        Mark Johnson Newbie

                        hmm, i don't know what else to say, but it might help to isolate to see if there isa problem with the service install or elsewher.e

                        Why not try creating a simple helloworld app that writes to a file upon startup and just goes into a loop or something, and try to use javaservice to install that as a service.

                        Also, there are several applications out there that can make an NT service from a java app (try yahoo or google, search on 'install Java NT Service')

                        Sorry I can't be of more help.

                        --Mark

                        • 9. Re: Error starting JBoss as an MS Win NT service.
                          Paul Newbie

                          Thanks Mark for sticking with me on this one, This is the first time I have manually setup a NT service. Here is want I have found out so far. I tried installing a simple Java Application as a service that outputs some text to a file every five seconds.

                          <code snippet>
                          new PrintWriter(new BufferedWriter(new FileWriter(OUTPUTFILE, true))
                          </code snippet>

                          When I try to start the service I get the following errors in the event viewer, even if I user the administrator Id. I check the jvm.dll, all it has is the archive bit set on. I also tried a 1.4.0 and 1.3.0 JVM with the same results. What is the "LoadLibrary" defined to be for a service?

                          <Event Viewer error message>
                          The description for Event ID ( 4097 ) in Source ( JSTest ) could not be found. It contains the following insertion string(s): LoadLibrary, Access is denied.
                          </ Event Viewer error message>

                          <Event Viewer error message>
                          The description for Event ID ( 4096 ) in Source ( JSTest ) could not be found. It contains the following insertion string(s): Could not load the Java Virtual Machine..
                          </ Event Viewer error message>

                          • 10. Re: Error starting JBoss as an MS Win NT service.
                            Mark Johnson Newbie

                            Well,

                            I think then we've elimated JBoss as being the problem since your test app doesn't work.

                            This is a long shot, but, a virus hoax has been going around for a while now saying that if you have the file 'jdbgmgr.exe' on your machine it is a virus and you should delete it. Unfortuanately, this file is actually used by the system as some sort of Java debugger. I have this file in windows\system32.

                            Also, I did a check of my system and I have jvm.dll files all over the place, none of them are in the windows/ folder.

                            I use JDK1.3.1, and I assume that the jvm is loaded from the jdk1.3.1 directory.... althought I can't verify this.

                            When you installed the service, did you use hotspot, classic, or server to install it? Maybe you don't have the complete JVM installation.

                            I'm grasping at straws here, but I would suggest to completely wipe out the JDK's on your system, as well as the JBoss service and any path variables that reference the jdk directories, reboot, and reinstall the JVM of your choice from a fresh download from java.sun.com. reboot again and first try starting JBoss via the command line, then try the service install.

                            I hope you get it working!

                            --Mark

                            • 11. Re: Error starting JBoss as an MS Win NT service.
                              Paul Newbie

                              Never did get this fixed in NT, I had to go to Windows 2000 Pro., for other reasons, which had the added benefit of fixing this problem.