No apologies necessary! I am not an NT guru either, I just have had to do
this before.

It may be possible to get cmd /c etc to run as a service with srvany.exe, 
a generic exe-to-service wrapper, though I doubt it would work. There are
also several other problems:
Services have no access to environment, so paths are non-existant/useless
so, for example, the jvm, even if started with it's full path, may not find
its own dll's.. common problem

Why have an instance of cmd.exe running when what you really want is java? 
Aside from this, cmd.exe needs the screen to display on, and will force open

a console, and I belive this wont work as a service - though I have not
tried.

Finally, I just dont think you could get cmd /c etc to run as a service..
again
I have not tried it, mostly due to the other problems above. Easier to wrap
a jvm inside a c prog and make sure everything is accessed via Java and
exists on the classpath.

Russell


-----Original Message-----
From: Tom Cook [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 01, 2001 5:02 PM
To: jBoss
Subject: RE: [jBoss-User] Starting as a service under NT?


My apologies.  I am not an NT guru (or user).  I assumed jboss was being
started in the normal way, just from a service.

BTW, why can't you just run cmd with '/C a_batch_file.bat' as an argument as
a
service?

Tom

On Fri, 02 Feb 2001, you wrote:
> There would be no batch file if you are starting the program as a service.
> Batch files cannot be started as NT services. You have to write a C/C++
prog
> with an embedded JVM to run Java code as a service.
> 
> The one fix is to make sure that everything looked for is found by
> classpath,
> ie files are found as resources, etc, and use -Djava.classpath=<all your
> needed
> paths>
> 
> Russell
> 
> -----Original Message-----
> From: Tom Cook [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 01, 2001 3:28 PM
> To: jBoss
> Subject: Re: [jBoss-User] Starting as a service under NT?
> 
> 
> Errrmmmmm... I hate pointing the obvious out to competent people, but how
> about
> 'cd %JBOSS_HOME%' at the top of your batch file?
> 
> Tom
> 
> On Fri, 02 Feb 2001, you wrote:
> > Hi,
> > 
> >   We have recently replaced Weblogic with jBoss in a high profile
> > application.  We are very pleased with our results so far.
> > 
> >   We are preparing to enter testing with our application, and we have
> > been spending the past few days configuring our testing environment.  We
> > need to make jBoss start as a service under 2000.
> > 
> >   There are many packages around the web that promise to 'start any
> > executable as a service', and we have one of these up and running, using
> > a batch file to start jBoss.  But there is a very elegant package for
> > starting java programs as services we would like to use, located at
> > 
> > http://www.roeschter.com/index.html
> > 
> >   The problem we are having is that jBoss wants to start from a
> > particular directory (the jBoss/bin directory), and we can't really
> > control this when starting as a service.  We get a little farther when
> > we specify -Duser.dir=<path_to_jBoss_bin>, but now we fail when
> > instantdb is looking for a file.
> > 
> >   I guess the question I'm asking could be phrased a couple different
> > ways:  1) Is there a way to start jBoss in such a manner that it doesn't
> > care where you are launching it from?  if not, 2) is there a way to
> > specify (via a registry entry or something) the working directory for a
> > service under NT/2000?
> > 
> >   We are a group of pretty competent developers, and can contribute our
> > work back to jBoss...  based on the example from the service-starting
> > package above, we have a 'wrapper' that implements stoppable and starts
> > jBoss...  between that and the Free .exe file from that site, it would
> > make a nice add-on for jBoss when running in the (crippled) windows
> > NT/2000 environment.
> > 
> > 
> > -David Bock
> > Software Engineer,
> > FGM, inc.
> > 
> > 
> > 
> > --
> > --------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > List Help?:          [EMAIL PROTECTED]
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to