You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Boyce, David" <Da...@FMR.COM> on 2001/04/24 22:48:53 UTC

Tomcat and NT service via wrapper script?

Short version: I need to run Tomcat as a service on NT (and know how to do
so) but need a hook to run an arbitrary command as part of the service
startup.
Details: I'm running Tomcat out of a ClearCase view (for those unfamiliar,
ClearCase is a dynamic filesystem abstraction with a metalanguage allowing
you to specify which versions of files you want to see, e.g. "the state as
of 3:34 PM yesterday" or "my changes but no one else's", etc. But note that
my problem has nothing to do with ClearCase per se). Running in a view has
many advantages, especially for development, as deployment (or rollback)
becomes as simple as changing a line of metalanguage to select newer (or
older) versions.

However, the use of ClearCase is a red herring; the only concern is that the
"view" must be started with the command "cleartool startview <view-name>"
before Tomcat runs. I'm doing this on UNIX now and it works just great with
a little bit of scripting. But I now need to do the same thing on Windows;
unfortunately the whole "service" business there seems pretty intractable.
All I need is a hook to run the startview command prior to Tomcat startup
but I haven't been able to dig up documentation on how or whether it can be
done.

To save time let me enumerate what I don't need: I know how to run Tomcat as
a service on NT and have done so successfully. I'm aware of the JDK 1.3.0
bug which affects this. I realize that ClearCase (which also runs as a
service on NT) must be started prior to Tomcat and have read up on how to
edit service dependencies in the registry. All I still need is a way to run
an arbitrary command (which happens in my case to be "cleartool startview")
as part of the service startup sequence. Has anyone done something similar?

Thanks in advance,
David Boyce


Re: An easy one?...Tomcat & IIS

Posted by Barbara Baughman <ba...@utdallas.edu>.
The "servlet/" needs to be there to tell the browser client that this is a
java servlet.  Most browsers discern the filetype from the file extension
(.html, .htm, .jsp, etc.).  Since the file reference to a servlet does not
have a file extension, the addition of "servlet/" is necessary to identify
the file as a servlet filetype to the browser.  Since you have no control
over how your client browsers work, there is nothing you can do to change
this convention.

Barbara Baughman
Systems Analyst
University of Texas at Dallas

On Tue, 24 Apr 2001, Scott Weaver wrote:

> 
> Hello all,
> 
> I'm sure you've seen this question asked before or even answered it.
> 
> I have Tomcat running and all the examples in the webapps dir work fine and
> I can add my own servlets to webapps and they work and I can create a
> directory outside webapps and run a servlet but they all have to be run
> using:
> 
> http://myserver:8080/mydir/servlet/myservlet
> 
> I want to run it here:
> http://myserver/mydir/myservlet
> 
> What do I have to modify or create to get it to do this?
> 
> I understand that Tomcat is running on 8080 and that is how I'm accessing my
> servlet but can't I go through port 80 and have IIS redirect to Tomcat?
> 
> I've come this far and the solution is probably staring me in the face but
> it's Tuesday "and the brain is numb" already.
> 
> Thanks for the help in advance,
> 
> Scott
> 
> 


RE: An easy one?...Tomcat & IIS

Posted by Rob Shorney <ro...@northgate-is.com>.
Hi,

I had the same trouble, however my app now works all I had to do was to
amend the uriworkermap.properties file.

There is a line in there that says /examples/*=ajp12.

I was having to do //servername:8080/OSS/Index.jsp

I added the following line to the file uriworkermap.properties

/OSS/*=ajp12

Now I can use //servername/OSS/Index.jsp

Regards

Rob Shorney

===========================================
Rob Shorney : Local Government Software Services
northgate information solutions.

email: rob.shorney@northgate-is.com

The opinions herein are my own and,
unless explicitly stated, do not
represent those of northgate information solutions.

This email has been sent using Microsoft Outlook 2000.
===========================================

-----Original Message-----
From: Scott Weaver [mailto:sweaver@wirelesstelematics.com]
Sent: 24 April 2001 23:33
To: tomcat-user@jakarta.apache.org
Subject: An easy one?...Tomcat & IIS


Hello all,

I'm sure you've seen this question asked before or even answered it.

I have Tomcat running and all the examples in the webapps dir work fine and
I can add my own servlets to webapps and they work and I can create a
directory outside webapps and run a servlet but they all have to be run
using:

http://myserver:8080/mydir/servlet/myservlet

I want to run it here:
http://myserver/mydir/myservlet

What do I have to modify or create to get it to do this?

I understand that Tomcat is running on 8080 and that is how I'm accessing my
servlet but can't I go through port 80 and have IIS redirect to Tomcat?

I've come this far and the solution is probably staring me in the face but
it's Tuesday "and the brain is numb" already.

Thanks for the help in advance,

Scott


An easy one?...Tomcat & IIS

Posted by Scott Weaver <sw...@wirelesstelematics.com>.
Hello all,

I'm sure you've seen this question asked before or even answered it.

I have Tomcat running and all the examples in the webapps dir work fine and
I can add my own servlets to webapps and they work and I can create a
directory outside webapps and run a servlet but they all have to be run
using:

http://myserver:8080/mydir/servlet/myservlet

I want to run it here:
http://myserver/mydir/myservlet

What do I have to modify or create to get it to do this?

I understand that Tomcat is running on 8080 and that is how I'm accessing my
servlet but can't I go through port 80 and have IIS redirect to Tomcat?

I've come this far and the solution is probably staring me in the face but
it's Tuesday "and the brain is numb" already.

Thanks for the help in advance,

Scott


Re: Tomcat and NT service via wrapper script?

Posted by Keith Gross <gr...@mail.tds.net>.
I haven't done what you're looking to do but I did do a lot of research on
the NT service wrapper for Tomcat while trying to overcome the user logoff
problem that JDK 1.3.0 has.  I can see one promising possibility.  The
service wrapper uses the wrapper.properties file in the conf sub-directory
to form a command line that is used to launch Tomcat in a separate process.
You can see the commandline in the last line of the file.  You could
possibly rewrite the command line to instead run the command processor
(cmd.exe) with a batch file that would run your command and than start
Tomcat.  I'm at home and most of my research was done at work so if you have
questions or problems post them and I'll consult my notes at work.

Any number problems could come up with this arrangement.

1). The way the service wrapper launches the sub-process might prevent the
command processor from being launched as desired.
2). The context your running in (i.e. as a service and under the system
account) might make interacting with ClearCase difficult.  Pathing and
security are the two most likely issues here.
3). If the ClearCase command takes to long it will causes the service
manager to think the service has failed and shut things down.

Good luck,
Keith Gross

----- Original Message -----
From: Boyce, David <Da...@FMR.COM>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 24, 2001 3:48 PM
Subject: Tomcat and NT service via wrapper script?


> Short version: I need to run Tomcat as a service on NT (and know how to do
> so) but need a hook to run an arbitrary command as part of the service
> startup.
> Details: I'm running Tomcat out of a ClearCase view (for those unfamiliar,
> ClearCase is a dynamic filesystem abstraction with a metalanguage allowing
> you to specify which versions of files you want to see, e.g. "the state as
> of 3:34 PM yesterday" or "my changes but no one else's", etc. But note
that
> my problem has nothing to do with ClearCase per se). Running in a view has
> many advantages, especially for development, as deployment (or rollback)
> becomes as simple as changing a line of metalanguage to select newer (or
> older) versions.
>
> However, the use of ClearCase is a red herring; the only concern is that
the
> "view" must be started with the command "cleartool startview <view-name>"
> before Tomcat runs. I'm doing this on UNIX now and it works just great
with
> a little bit of scripting. But I now need to do the same thing on Windows;
> unfortunately the whole "service" business there seems pretty intractable.
> All I need is a hook to run the startview command prior to Tomcat startup
> but I haven't been able to dig up documentation on how or whether it can
be
> done.
>
> To save time let me enumerate what I don't need: I know how to run Tomcat
as
> a service on NT and have done so successfully. I'm aware of the JDK 1.3.0
> bug which affects this. I realize that ClearCase (which also runs as a
> service on NT) must be started prior to Tomcat and have read up on how to
> edit service dependencies in the registry. All I still need is a way to
run
> an arbitrary command (which happens in my case to be "cleartool
startview")
> as part of the service startup sequence. Has anyone done something
similar?
>
> Thanks in advance,
> David Boyce
>


Re: Tomcat and NT service via wrapper script?

Posted by Jaye Speaks <js...@yahoo.com>.
NT Resource toolkit provides a utility to run programs as a service.  Wrapping your program in it might do the trick.


*********** REPLY SEPARATOR  ***********

On 4/24/2001 at 4:48 PM Boyce, David wrote:

>Short version: I need to run Tomcat as a service on NT (and know how to do
>so) but need a hook to run an arbitrary command as part of the service
>startup.
>Details: I'm running Tomcat out of a ClearCase view (for those unfamiliar,
>ClearCase is a dynamic filesystem abstraction with a metalanguage allowing
>you to specify which versions of files you want to see, e.g. "the state as
>of 3:34 PM yesterday" or "my changes but no one else's", etc. But note that
>my problem has nothing to do with ClearCase per se). Running in a view has
>many advantages, especially for development, as deployment (or rollback)
>becomes as simple as changing a line of metalanguage to select newer (or
>older) versions.
>
>However, the use of ClearCase is a red herring; the only concern is that
>the
>"view" must be started with the command "cleartool startview <view-name>"
>before Tomcat runs. I'm doing this on UNIX now and it works just great with
>a little bit of scripting. But I now need to do the same thing on Windows;
>unfortunately the whole "service" business there seems pretty intractable.
>All I need is a hook to run the startview command prior to Tomcat startup
>but I haven't been able to dig up documentation on how or whether it can be
>done.
>
>To save time let me enumerate what I don't need: I know how to run Tomcat
>as
>a service on NT and have done so successfully. I'm aware of the JDK 1.3.0
>bug which affects this. I realize that ClearCase (which also runs as a
>service on NT) must be started prior to Tomcat and have read up on how to
>edit service dependencies in the registry. All I still need is a way to run
>an arbitrary command (which happens in my case to be "cleartool startview")
>as part of the service startup sequence. Has anyone done something similar?
>
>Thanks in advance,
>David Boyce

s


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com