You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by an...@on.com on 2001/02/26 22:30:47 UTC

Problem in Jakarta-Tomcat running in WinNT with multiple NICs


Hi,
        I'm using Jakarta-Tomcat as the servlet container and also as the
default web server listening to 8080 port for a Servlet-Jsp based application.
 The Servlet has a background thread running that communicates asynchrnously
(asynchronous to the HTTP requests) with an external process. This background
thread is implemented as a different object that gets instantiated from the
init() method of the Servlet. The external process executed (by
Runtime.getRuntime.exec()) is a proprietary command line tool. This background
thread, after being instantiated, executes this process, gets the output, input
and error streams associated with the process and then periodically writes to
the output stream and reads from the input stream.Everything works fine in both
Win32 and UNIX platforms.

If I start up Tomcat on a WINNT machine that has dual NICs (Network
Identification Card) connected to it, the  reading from the input stream never
happens as the inputstream.read() call never returns true.  If I just disconnect
one of the network connections then everything starts to work again. I've tried
changing the priorites of the background thread, yielding it, putting it to
sleep for a while but the inputstream just never gets ready to be read. I
actually wrap the InputStream out of the external process with an
InputStreamReader. In csae of multiple NICs, the InputStreamReader.ready() never
returns true.

The command line tool itself doesn't have any problem with multiple NICs as I
have tested. My java class (that runs as the background thread) also works fine
in multiple NIC environment if invoked as a NT service (after wrapping by C++)
or if simply started from the command line. Only when it's instantiated from the
Servlet running under jakarta-tomcat I face the problem mentioned above.

Any help/idea/pointers will be really appreciated.

                                                    Regards, Atanu