-
1. Re: JBoss+Tomcat Running as a Service
lsanders Jan 5, 2002 11:25 PM (in response to nightowl)I do this using the cygwin tools (www.cygwin.com). These are a set of standard unix tools that run on Windows. They include a suite of windows administrative tools, including cygrunsrv.
Once installed, you can create a service from a cygwin prompt like this:
cygrunsrv -I JBoss -p /cygdrive/c/jboss/bin/run.bat
-Larry
> Is there a way to run the JBoss+Tomcat installation
> on Windows 2000 as a Service? Currently, I must
> manually login to an account and start it on the
> command line.
>
> SY -
2. Re: JBoss+Tomcat Running as a Service
adrian.brock Jan 6, 2002 12:42 AM (in response to nightowl)There is an nt service contribution in JBoss's CVS
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/contrib/ntservice
or download all the plugins at
http://www.jboss.org/developers/cvs.jsp
BUT this looks to be far from complete.
It more like somebody just dropped the javants
distribution into cvs without doing any
configuration for JBoss :-(
Regards,
Adrian -
3. Re: JBoss+Tomcat Running as a Service
yalmasri Jan 10, 2002 10:49 AM (in response to nightowl)Hello Larry,
I tried to get Tomcat to run as service using this way; the service was installed successfully, but it couldn't start. I guess the problem is from the path option (-p), which look weird to me somewhat. Did you do any special steps other than typing this line? For tomcat installation, I typed this:
cygrunsrv --install Tomcat --path D:\jakarta-project\tomcat\bin\startup.bat
I don't know if that was correct, can you please help me?
Thanx -
4. Re: JBoss+Tomcat Running as a Service
adrian.brock Jan 10, 2002 1:49 PM (in response to nightowl)Nearly correctly.
Don't forget cygwin is a unix tools port so it
uses / instead of \
Also it uses /cygdrive/d instead of d:
So you should have
--path /cygdrive/d/jakarta-project/tomcat/bin/startup.bat
Regards,
Adrian -
5. Re: JBoss+Tomcat Running as a Service
yalmasri Jan 12, 2002 2:27 AM (in response to nightowl)Thanks Adrian, that was the problem.
-
6. Re: JBoss+Tomcat Running as a Service
yalmasri Jan 12, 2002 5:30 AM (in response to nightowl)Oops! It sounds that I ran into trouble again.
Tomcat alone started just fine as a service, but I don't know what happened when I tried to start JBoss the same way, here's what I did:
I typed this on my command shell:
cygrunsrv --install JBoss --path /cygdrive/d/JBoss-2.2.2_Tomcat-3.2.2/jboss/bin/run_with_tomcat.bat
"run_with_tomcat.bat" has the following script:
@echo off
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVA_HOME%/lib/tools.jar
.\run.bat tomcat
"run.bat" exists in the same directory and look like this:
@echo off
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;run.jar
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;../lib/xerces_1_4_0.jar
set JAXP=-
Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
set JAXP=%JAXP% -
Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
java %JAXP% -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
The service was installed successfully, but when I tried to start it using:
cygrunsrv --start JBoss
I got this error:
cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062: The service has not been started.
I'd be grateful if anybody can help me in this, I really am in need to run it as service. -
7. Re: JBoss+Tomcat Running as a Service
adrian.brock Jan 12, 2002 11:55 AM (in response to nightowl)Have you looked in JBOSS_HOME/log/server.log?
Did you remember to stop Tomcat before starting
JBoss/Tomcat?
Regards,
Adrian -
8. Re: JBoss+Tomcat Running as a Service
adrian.brock Jan 12, 2002 12:53 PM (in response to nightowl)Also, the fact that the batch program does not
return may be confusing windows.
Try changing the line beginning
.\run.bat
to
start .\run.bat
I can't give you much more help, I haven't tried doing
this myself.
Regards,
Adrian -
9. Re: JBoss+Tomcat Running as a Service
bytor2002 Jan 21, 2002 12:12 PM (in response to nightowl)Someone posted a response about this. There is a tool that allows any Java application to run as a service. Here is the link to the home page. Disclaimer: I have not tried this myself (yet).
http://www.eworksmart.com/JNT/
-Michael Schulz -
10. Re: JBoss+Tomcat Running as a Service
jdelozier Feb 1, 2002 12:13 AM (in response to nightowl)*********************************
***** The Problem Explained *****
I tried the JNT Service Wrapper and it works great ... for a second (if that long). Let me explain. First, I created the service with the following command:
jnt "/InstallAsService:JBoss Catalina" "/SDp:\JBoss-2.4.4_Tomcat-4.0.1\jboss\bin" -classpath".;%JAVA_HOME%\lib\tools.jar;run.jar;..\lib\crimson.jar" -Dshutdown.method=org.jboss.Shutdown.main -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl org.jboss.Main catalina
It installed the service w/o a hitch. I started the service, great so far. Opened a browser and tried http://localhost:8080/jboss and ... "Page could not be found"
I checked the log file the JNT Wrapper created for errors and found none. However, the log file did record a shutdown process.
I think what is happening is the service is running org.jboss.Main correctly, returning from Main and stopping.
Also, the "shut down gracefully" feature of JNT Wrapper requires the shutdown method to reside within the initial start class (ie org.jboss.Main). The default source code does have a shutdown method, but it resides within it own class, namely org.jboss.Shutdown.
************************************
***** What I think is occuring *****
When JBoss starts, it runs in the "Command Prompt" process. When you close the command prompt, it destroys that process, thus shutting down JBoss. In other words, JBoss is alive, as long as it's pocess ("Command Prompt") is still alive.
However, when you run JBoss as a JNT Service, it resides within it's own process. Therefore, when it returns from Main, it desroys it's own thread.
****************************************
***** What I think is the solution *****
If this is true, then to fix the problem, instead of returning from Main, it needs to initate a listener and wait for a shutdown command. Then return from main, and thus shutdown.
**********************
***** Conclusion *****
Am I right, or wrong, or what? Any thought at all ... -
11. Re: JBoss+Tomcat Running as a Service
livejavabean Mar 3, 2002 3:20 AM (in response to nightowl)man i spent 3 hours finally find a doc has this info...
no JNT no cygwin no nothing except javants.exe. dang this file is being used by jboss developer whey they don't share this?
wat da.
hope it helps u dude:
http://www.hta-bi.bfh.ch/Projects/aaps/docbook_html/x794.html
beware with those PATH -
12. Re: JBoss+Tomcat Running as a Service
guy_rouillier Mar 14, 2002 11:22 PM (in response to nightowl)javants had a bug in it. I found it and fixed it. See bug 530166 in the sourceforge jboss section. With this fix, javants works well. I'm using it for both JBoss and Tomcat running separately. I also have sample properties files for each if anyone is interested.
-
13. Re: JBoss+Tomcat Running as a Service
mheidimcclure Mar 19, 2002 2:16 PM (in response to nightowl)I hope you are listening guy_rouillier...
I would like copies of your properties files, but your email bounced back at me with @home.com as an unknown host.
thank you,
-heidi
heidi@iswsolutions.com -
14. Re: JBoss+Tomcat Running as a Service
guy_rouillier Mar 19, 2002 2:51 PM (in response to nightowl)I can't figure out how to change my email address. That one has expired. I'm sending you the properties files.