Chris,

The "ls" command is only an example to demonstrate the problem.


Mo.

> -----Original Message-----
> From: Chris Pratt [SMTP:[EMAIL PROTECTED]]
> Sent: 08 October 1999 18:23
> To:   [EMAIL PROTECTED]
> Subject:      Re: Simple Servlet works fine with servletrunner, hangs in
> Netscape E nterprise Server 4.0
>
> Try using java.io.File.list() instead of forking the process.  You'll get
> the same results, and you won't incur process overheads and you'll remain
> portable.
>     (*Chris*)
>
> ----- Original Message -----
> From: Sahirad, Mohammed (London) <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, October 08, 1999 4:23 AM
> Subject: Simple Servlet works fine with servletrunner, hangs in Netscape E
> nterprise Server 4.0
>
>
> > All,
> > I have got a simpe servlet whose code is enlosed.
> > It runs ok in servletrunner on a Solaris box.
> > When you run it with NES 4.0 as the Web Server, then there are two
> > independent problems with it.
> >
> > 1-
> > The line
> > Process p = Runtime.getRunTime().exec("ls");
> >
> > sends the machine CPU to near 100%. The only soultion is the brig the
> Web
> > Server down!!
> >
> > 2-
> >
> > The servlet hangs at the line
> > int e = p.waitFor();
> > which is currently commented out.
> >
> > Any help will be appreciated.
> >
> > Regards,
> > Mo.
> >
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> > import java.io.*;
> >
> > public class ServletExec extends HttpServlet
> > {
> >       public void doGet(HttpServletRequest req, HttpServletResponse res)
> >         throws ServletException, IOException
> >       {
> >          PrintWriter out = res.getWriter();
> >
> >          Process p = Runtime.getRuntime().exec("ls");
> >
> >          BufferedReader in = new BufferedReader(new
> > InputStreamReader(p.getInputStream()));
> >
> >          String s = null;
> >
> >          while ((s = in.readLine()) != null)
> >          {
> >             out.println(s);
> >          }
> >
> >          boolean finished = false;
> >
> > //         try
> >  //        {
> >             while (! finished)
> >            {
> > //               System.out.println("waiting");
> >  //              int e = p.waitFor();
> >   //             System.out.println("done");
> >
> >                int e = 20;
> >
> >                out.println("Process Returned: " + e);
> >                finished = true;
> >             }
> >  //        }
> >   //       catch (InterruptedException e)
> >    //      {
> >     //     }
> >       }
> > }
> >
> >
> >
> >
> >
> >
> > Mohammad Sahirad
> > Merrill Lynch Swaps Technology
> > RMP-06-05
> > 6A Ropemaker
> > 25 Ropemaker Street
> > London EC2Y 9LY
> > +44 (0)171 867 4925
> >
> >
> __________________________________________________________________________
> _
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to