10 Replies Latest reply on Sep 5, 2003 4:55 PM by dipaka

    JBossTomcat3.2 & JavaService not working?

    harlequinn Newbie

      Does JBoss3.2 still work with JavaService at all? I posted a while ago about odd errors I got at JBoss startup when running it with JavaService. Errors are ClassNotFoundErrors that start with javax.naming.Util class not being found.

      I get no errors when I use the provided run.bat scripts, running the default server. On three separate win2k installations I get the abovementioned error. One instance of that class is found under server lib-directory, inside jboss.jar. However, I understood those jars should automatically be in server classpath, so I find the error message really odd.

      I got no replies in my previous post, and I was left unsure if this is because nobody else is experiencing this, or if nobody just had no clue what this could be. This is a very important issue for me to solve, for it is unacceptable to run jboss as a console application. Only alternative would be to use some other service program. But I kind of like JavaService.

      So how on earth could the server not find its lib-directory when running as a service? Or what could be the cause of those messages. Default server is unmodified, and as I said, three separate installations give me this problem. Also I find it odd that nobody else seems to be experiencing this. I got this with both JBoss 3.2 and 3.2.1 installations as well.

      If anyone has even wild ideas to try, toss them for discussion. I'm willing to test them out.

        • 1. Re: JBossTomcat3.2 & JavaService not working?
          Thunder Williams Newbie

          your are correct. getting this configured is difficult. i still have not succeeded. i have played with JavaService and all different configurations of classpath and such. i am lost at this point but still trying...

          JavaService -install Server c:\jdk\jre\bin\server\jvm.dll -Djava.class.path="c:\jdk\lib\tools.jar;c:\jboss\bin\run.jar;c:\jboss\lib\crimson.jar;C:\jboss\log;C:\jboss\lib\ext\activation.jar;C:\jboss\lib\ext\castor-0.9.1.jar;C:\jboss\lib\ext\catalina-service.jar;C:\jboss\lib\ext\gnu-regexp-1.0.8.jar;C:\jboss\lib\ext\hsql.jar;C:\jboss\lib\ext\hsqldb.jar;C:\jboss\lib\ext\jboss-j2ee.jar;C:\jboss\lib\ext\jboss-management.jar;C:\jboss\lib\ext\jboss.jar;C:\jboss\lib\ext\jbosscx.jar;C:\jboss\lib\ext\jbossmq.jar;C:\jboss\lib\ext\jbosspool.jar;C:\jboss\lib\ext\jbosssx.jar;C:\jboss\lib\ext\jce1_2_1.jar;C:\jboss\lib\ext\jcert.jar;C:\jboss\lib\ext\jmxtools.jar;C:\jboss\lib\ext\jndi.jar;C:\jboss\lib\ext\jnet.jar;C:\jboss\lib\ext\jnpserver.jar;C:\jboss\lib\ext\jpl-util-0_5b.jar;C:\jboss\lib\ext\jsse.jar;C:\jboss\lib\ext\log4j.jar;C:\jboss\lib\ext\mail.jar;C:\jboss\lib\ext\oswego-concurrent.jar;C:\jboss\lib\ext\ots-jts_1.0.jar;C:\jboss\lib\ext\tyrex-;C:\jboss\lib\ext\xalan.jar;C:\jboss\tmp\;C:\jboss\db\;C:\catalina\common\lib\naming-common.jar;C:\catalina\common\lib\naming-resources.jar;C:\catalina\common\lib\servlet.jar;C:\catalina\server\lib\catalina.jar;C:\catalina\server\lib\jakarta-regexp-1.2.jar;C:\catalina\server\lib\servlets-common.jar;C:\catalina\server\lib\servlets-default.jar;C:\catalina\server\lib\servlets-invoker.jar;C:\catalina\server\lib\servlets-manager.jar;C:\catalina\server\lib\servlets-snoop.jar;C:\catalina\server\lib\servlets-webdav.jar;C:\catalina\server\lib\tomcat-ajp.jar;C:\catalina\server\lib\tomcat-util.jar;C:\catalina\server\lib\warp.jar;C:\catalina\bin\bootstrap.jar;C:\catalina\lib\jasper-compiler.jar;C:\catalina\lib\jasper-runtime.jar;C:\catalina\lib\naming-factory.jar" -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl -Djava.security.policy=policy.all -start org.jboss.Main -stop org.jboss.Shutdown -out stdout.log -err stderr.log -current c:\jboss\bin

          • 2. Re: JBossTomcat3.2 & JavaService not working?
            Francois Landry Newbie

            I have the same problem here. I have used JavaService for a long time with version 3.0.x without problem. I cannot make it work with version 3.2.x, always a missing class. I added the necessary stuff to the class path until the command line was too long...

            now, what's next?

            • 3. Re: JBossTomcat3.2 & JavaService not working?
              harlequinn Newbie

              *bump* Any solutions to this one? I figured out that the faulty classpath affects ALL jars;

              For example, I can configure JBoss to send me email on errors. This works fine when I start it by running the run.bat script, but fails miserably when I try to run it as a service. Again, a classpath error.

              Seems like using javaservice screws up the classpaths somehow, so that JBoss can't find anything that isn't mentioned when registering it as a service.

              Any way to fix this one? Any ideas? At least a few of us are experiencing this, and I've searched everyplace for an answer. This is a show-stopper for me, if I can't run it as a service on windows platform, I can't use it. Which is really terrible because I kinda like it. A lot.

              • 4. Re: JBossTomcat3.2 & JavaService not working?
                Bob Newbie

                I got it to work with JavaService. You're right, the difficulty is with the classpath. Specifically it is the all the jar files in the lib folder. I modified the scripts a little bit to correct the problem.

                If you open the zip folder I'm including you will notice I changed the name of JavaService.exe to Jboss.exe so I can see it running under Jboss in task manager, but it's the same program

                • 5. Re: JBossTomcat3.2 & JavaService not working?
                  Bob Newbie

                  Ok I must be bored, but here's another solution. This one allows you to specify a dependancy, so for example MySql will be running whenever JBoss is started. When I went through this originally I didn't notice this thread statesTomcat3.2. I haven't tested it with it. I'm using JBoss 3.2.1 with the built in Jetty. Hopefully this will still work for the Tomcat versions as well.

                  Install the files in the attached .zip file to %JBOSS_HOME%\bin and execute InstallJBossService.cmd <Startup_type>

                  Special thanks to Jrutter (see http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= )


                  • 6. Re: JBossTomcat3.2 & JavaService not working?
                    harlequinn Newbie

                    Thank you very much for the example script! It was an interesting and effective way to use command line scripting, hadn't thought of that one.

                    Unfortunately it didn't work for me. I kind of suspected that it is an issue with the integrated Tomcat version anyway, this seems to prove it.

                    The problem isn't so much jboss\lib dir, which can be fixed like this (I've added them all manually before) - the problem is server lib directory, which also doesn't get included. This is a more serious issue, for I do not wish to add all server lib jars to classpath as well, I think they should be automatically found. At least at server startup I get messages of jboss lib dir and server lib dir which point to proper locations.

                    First error I get points to java.lang.NoClassDefFoundError: org/jboss/naming/Util - which resides in one of the .jars under the default server which I'm trying to set up.

                    I did try adding this line here to also include those .jars:

                    for %%f in ("%JBoss_Home%\server\%2\lib\*.jar") do call "%JBoss_Home%\bin\lcp.bat" %%f

                    - result being that classpath became obviously too long; I got :

                    The input line is too long.
                    was unexpected at this time.

                    ..from the script.

                    So this remains unsolved. It would be possibility to trash the built-in tomcat and use jetty instead. However, I am familiar with Tomcat and like it very much, and I think this kind of thing really shouldn't be any issue at all. If I just figured out what to do about this..

                    • 7. Re: JBossTomcat3.2 & JavaService not working?
                      Cevdet Dengi Newbie

                      I have got the same problem and I am a little bit confused. I don't think I should include all the libraries that JBoss needs in the classpath of JavaService. However I tried it but could not succeeded.
                      Is there anybody here who have successfully run JBoss 3.2.1 + tomcat 4.1.24 as a windows service usind JavaService? If yes How?


                      • 8. Re: JBossTomcat3.2 & JavaService not working?
                        Bryan Ross Newbie

                        I have JBoss 3.2.1 running as a Windows service using Java Service Wrapper without any issues.


                        I can provide a copy of my configuration file if necessary.

                        • 9. Re: JBossTomcat3.2 & JavaService not working?
                          Cevdet Dengi Newbie

                          I used Java Service Wrapper and it works fine. Thank you for the help.

                          • 10. Re: JBossTomcat3.2 & JavaService not working?
                            dipaka Newbie

                            Hello everyone,

                            I'm attempting to use JavaService to make an NT Service out of an older version of JBoss, namely JBoss 2.4.4.

                            While I can start the service without issue, stopping the service is causing me no end of grief. Here's the appropriate snippet from my install line (I've added the line breaks for readability):

                            -start org.jboss.Main
                            -params catalina
                            -stop org.jboss.Shutdown

                            Now, the error message I get when stopping is

                            java.lang.NoClassDefFoundError: org/jboss/Shutdown

                            Based on my command-line above, it is because the Shutdown class is in a different classpath, namely %2\lib\ext\jboss.jar;. When I try to use this however, I get all kinds of exceptions on startup.

                            Sadly, all the JavaService docs out there seem to use JBoss 3.0 and above. Has anyone had any luck using JavaService with older JBoss versions?