What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

View: New views
9 Messages — Rating Filter:   Alert me  

What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Alan Kennedy-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I need to find out what is the difference between running Tomcat 6 as
a Windows Service and running it from the command line.

The reason is that I'm getting a bizarre bug when a jython based
servlet is run under Tomcat6-as-Service. But the bug does NOT appear
when Tomcat 6 is run from the command line using bin\startup.bat.

I'm using Windows Server 2003.

Rather than describe the whole thing in this email, I've recorded all
of the details in the jython bug tracker.

Jython crashes in unknown circumstances when running on Tomcat 6 as
Windows Service
http://bugs.jython.org/issue1489

Can anyone point me to documentation which describes the differences
between the two operating modes?

Regards,

Alan Kennedy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Markus Schönhaber-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alan Kennedy:

> I need to find out what is the difference between running Tomcat 6 as
> a Windows Service and running it from the command line.
>
> The reason is that I'm getting a bizarre bug when a jython based
> servlet is run under Tomcat6-as-Service. But the bug does NOT appear
> when Tomcat 6 is run from the command line using bin\startup.bat.

The most prominent difference I can think of is the user account Tomcat
runs as.
Although I have no idea why this should cause the endless recursion you
are seeing, I'd (temporarily) change the user account of the Tomcat
service to your personal account and see if the problem still exists.

--
Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Alan Kennedy-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[Alan]
>> I need to find out what is the difference between running Tomcat 6 as
>> a Windows Service and running it from the command line.
>>
>> The reason is that I'm getting a bizarre bug when a jython based
>> servlet is run under Tomcat6-as-Service. But the bug does NOT appear
>> when Tomcat 6 is run from the command line using bin\startup.bat.

[Markus]
> The most prominent difference I can think of is the user account Tomcat
> runs as.
> Although I have no idea why this should cause the endless recursion you
> are seeing, I'd (temporarily) change the user account of the Tomcat
> service to your personal account and see if the problem still exists.

Thanks for the suggestion Markus, it was a good one.

Unfortunately, it did not solve the problem: the behaviour is exactly
the same when running under my own account: the bug still occurs.

Regards,

Alan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Markus Schönhaber-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alan Kennedy:

> Unfortunately, it did not solve the problem: the behaviour is exactly
> the same when running under my own account: the bug still occurs.

Well, that seems to rule out any permission problems - and leaves me
pretty much out of ideas.
One thing, though: do you run Tomcat in both cases from the same
installation (same binary, same config etc.)? If not, maybe that's where
the difference is.

--
Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Peter Crowther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/19 Markus Schönhaber <tomcat-users@...>

> Alan Kennedy:
>
> > Unfortunately, it did not solve the problem: the behaviour is exactly
> > the same when running under my own account: the bug still occurs.
>
> Well, that seems to rule out any permission problems - and leaves me
> pretty much out of ideas.
>

There are other differences.  A Windows service doesn't load the user's
profile fully, for example.  Nevertheless, that's a horribly obscure bug.

A long shot. Does Jython use temp filestore for any purpose, for example
while compiling?  If so, it might not be seeing the variables it expects if
running as a service.  Watching the file and registry calls with Process
Explorer (used to be sysinternals, now on Microsoft's site) would quite
likely tell you a lot more, particularly if you could compare a successful
run as a non-service with a failed run as a service.

- Peter

Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Len Popp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 12:40, Alan Kennedy <alan.kennedy.name@...> wrote:
> Thanks for the suggestion Markus, it was a good one.
>
> Unfortunately, it did not solve the problem: the behaviour is exactly
> the same when running under my own account: the bug still occurs.
>
> Regards,
>
> Alan.

Besides the user account, other possible differences are which Tomcat
installation is being used, which Java installation is being used, and
various options passed to both Java and Tomcat. Max memory size and
thread stack size are a couple to look at. It's even possible that
you're running completely different versions of both Tomcat and Java
in the two scenarios.

For the Windows service the options are set in the "Configure Tomcat"
app (tomcat6w.exe). For startup.bat the options are set in various
environment variables and batch files. See the Tomcat docs for more
details because I sure can't remember them all. :-)
--
Len

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Earl Tom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Markus Schönhaber-10 wrote:
Alan Kennedy:

> I need to find out what is the difference between running Tomcat 6 as
> a Windows Service and running it from the command line.
>
> The reason is that I'm getting a bizarre bug when a jython based
> servlet is run under Tomcat6-as-Service. But the bug does NOT appear
> when Tomcat 6 is run from the command line using bin\startup.bat.

The most prominent difference I can think of is the user account Tomcat
runs as.
Although I have no idea why this should cause the endless recursion you
are seeing, I'd (temporarily) change the user account of the Tomcat
service to your personal account and see if the problem still exists.
Was there a solution found for this behavior?  

It is happening to me as well when I try to install Liferay portal as a service (Server 2008, 64-bit JVM, Tomcat 6.0.20 zip file installed with 64-bit tomcat6 and tomcat6w.exe files substituted).  

I also get a stack overflow error when running as a service, but normal behavior when using startup.bat .  After getting startup.bat to run, I installed the service using "service install".
If I run tomcat6 from the command line still as Administrator, it also fails.

I was able to extract a command line that successfully runs:

"C:\Program Files\Java\jdk1.5.0_16\bin\java"  -Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="C:/Tomcat/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="C:\Tomcat\conf\logging.properties"   -Djava.endorsed.dirs="C:\Tomcat\endorsed" -classpath "C:\Tomcat\bin\bootstrap.jar" -Dcatalina.base="C:\Tomcat" -Dcatalina.home="C:\Tomcat" -Djava.io.tmpdir="C:\Tomcat\temp" org.apache.catalina.startup.Bootstrap  start

Is there something I can do to troubleshoot?

Thanks for any assistance,

--
Earl Tom

Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Alan Kennedy-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[Alan]
>>> I need to find out what is the difference between running Tomcat 6 as
>>> a Windows Service and running it from the command line.
>>>
>>> The reason is that I'm getting a bizarre bug when a jython based
>>> servlet is run under Tomcat6-as-Service. But the bug does NOT appear
>>> when Tomcat 6 is run from the command line using bin\startup.bat.

[Earl]

> Was there a solution found for this behavior?
>
> It is happening to me as well when I try to install Liferay portal as a
> service (Server 2008, 64-bit JVM, Tomcat 6.0.20 zip file installed with
> 64-bit tomcat6 and tomcat6w.exe files substituted).
>
> I also get a stack overflow error when running as a service, but normal
> behavior when using startup.bat .  After getting startup.bat to run, I
> installed the service using "service install".
> If I run tomcat6 from the command line still as Administrator, it also
> fails.

Hi Earl,

I'm not sure if we're talking about the same bug, although it's easily
possible that it's the same bug, with differing consequences.

I've made a little more progress on what is happening in jython when
this problem occurs, namely a infinite recursion on method reflection.
I'm guessing that this may be caused by a combination of classloading
and security policies, not sure yet. More details from here

http://bugs.jython.org/issue1489

Note from that bug that we've had a report from a user who saw
identical behaviour when running a minimal jython servlet in BEA
WebLogic on Ubuntu, whereas the Tomcat on Ubuntu runs the code just
fine. So this is not a problem specific to Tomcat or to Tomcat on
Windows.

I'll be continuing my investigations and reports on the jython bug
report. Please feel free to follow that discussion and/or contribute
to it.

Regards,

Alan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: What is the difference between running Tomcat 6 as a Windows Service vs. running from the command line?

by Earl Tom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alan Kennedy-13 wrote:
[Alan]
>>> I need to find out what is the difference between running Tomcat 6 as
>>> a Windows Service and running it from the command line.
>>>
>>> The reason is that I'm getting a bizarre bug when a jython based
>>> servlet is run under Tomcat6-as-Service. But the bug does NOT appear
>>> when Tomcat 6 is run from the command line using bin\startup.bat.

[Earl]
> Was there a solution found for this behavior?
>
> It is happening to me as well when I try to install Liferay portal as a
> service (Server 2008, 64-bit JVM, Tomcat 6.0.20 zip file installed with
> 64-bit tomcat6 and tomcat6w.exe files substituted).
>
> I also get a stack overflow error when running as a service, but normal
> behavior when using startup.bat .  After getting startup.bat to run, I
> installed the service using "service install".
> If I run tomcat6 from the command line still as Administrator, it also
> fails.

Hi Earl,

I'm not sure if we're talking about the same bug, although it's easily
possible that it's the same bug, with differing consequences.

I've made a little more progress on what is happening in jython when
this problem occurs, namely a infinite recursion on method reflection.
I'm guessing that this may be caused by a combination of classloading
and security policies, not sure yet. More details from here

http://bugs.jython.org/issue1489

Note from that bug that we've had a report from a user who saw
identical behaviour when running a minimal jython servlet in BEA
WebLogic on Ubuntu, whereas the Tomcat on Ubuntu runs the code just
fine. So this is not a problem specific to Tomcat or to Tomcat on
Windows.

I'll be continuing my investigations and reports on the jython bug
report. Please feel free to follow that discussion and/or contribute
to it.
Alan,

I ran into a couple more relevant links:

Here's on that actually pertains to Tomcat and Liferay, the setup I'm trying:

http://www.liferay.com/web/guest/community/forums/-/message_boards/message/3095034

The claim is it's an artifact of compilation options.  The page mentioned for the binaries is here:

http://www.goldhahn.info/pmwiki.php/Software/TomcatBinaries

I downloaded tomcat6_64bit.exe and tomcat6w_64bit.exe, copied them to the bin directory, renamed them to tomcat6.exe and tomcat6w.exe, did the service install, and everything seems to run fine.

I don't know whether you're also running 64-bit Windows, but I hope this helps anyways.

-- Earl