Goran KEZUNOVIC wrote:

> Hi,
>
> I have set up Apache 1.3.6 with Jserv 1.0b4 (and b3 before that) on Linux
> (RedHat 5.2).  Servlets are working except for exec-ing unix commands, and
> there are no error messages.
>
> You can find example files on http://www.rdlab.carnet.hr/u/kenzo/servlet/
>
> Am I (as an Apache maintainer) or a friend of mine (as a servlet writer)
> doing something wrong?  I can provide more info if you tell me what you
> need.
>
> Thanks,
>
> Kenzo
> --
> Goran Kezunovic                         E-mail:  [EMAIL PROTECTED]
> Zagreb, CROATIA                       URL:  http://www.zesoi.fer.hr/~kenzo
>

A couple of suggestions to help you track this down:

* The sample form at your URL above wants to go to "localhost", so
  I cannot see what the result of trying to execute a command is.  (You
  probably don't want to leave this open to the Internet and let people
  execute unfriendly commands :-)

* You are not trapping an IOException that can be returned by the
  Runtime.exec() method -- if this is triggered, it will also abort your
  servlet and throw the IOException back to the servlet engine.  Put
  the exec() call in a try/catch block.

* Try the code in a standalone application that runs in the same environment
  as the servlet (same classpath as your zone repositories, same PATH as
  the servlet engine for finding executable binaries, and so on).  This will
  eliminate any servlet-engine dependencies until your own code works OK.

Craig McClanahan




----------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]
  • exec Goran KEZUNOVIC
    • Craig R. McClanahan

Reply via email to