You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Patrick Lee <pa...@horologe.com.au> on 2008/02/29 03:54:53 UTC

Unable to read shell environment variables

Hi,

I'm getting this error when trying to use CGI under tomcat on Windows
Server 2008":

javax.servlet.ServletException: Unable to read shell environment variables

This line also displays:

Cannot run program "env": CreateProcess error=2,

It looks like getShellEnvironment() is testing for specific versions
of Windows and 2008 is not one of them, then defaulting to the unix
call and throwing the "Cannot run program env" error.

I don't know enough about Windows 2008 to know if it's simply going to
be a matter of adding the new OS version to the if.

Tomcat version is 6.0.14

Does anyone know if this has been fixed in a newer 6 release or if
someone is already looking at it?

Thanks.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Unable to read shell environment variables

Posted by Mark Thomas <ma...@apache.org>.
Patrick Lee wrote:
> Does anyone know if this has been fixed in a newer 6 release or if
> someone is already looking at it?

I have just fixed trunk and proposed this fix for 6.0.x.
http://svn.apache.org/viewvc?rev=642391&view=rev

A fix has also been proposed for 5.5.x
http://people.apache.org/~markt/patches/2008-03-28-cgi-env.patch

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Unable to read shell environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Patrick Lee [mailto:patrick@horologe.com.au] 
> Subject: Re: Unable to read shell environment variables
> 
> In the code for CGIServelet.java there is no check for "windows vista"

As a workaround until this gets fixed, you can override the os.name
property on the command line (or in the Java tab of tomcat{5|6}w.exe if
running as a service).  Just set:

  -Dos.name="Windows 2008"

This should let you run CGI successfully.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Unable to read shell environment variables

Posted by Patrick Lee <pa...@horologe.com.au>.
On Fri, Feb 29, 2008 at 2:23 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:

>  When running a Java program under Win2008, what value does the system
>  property os.name have?

windows vista

>  What JVM version are you running?  (This has the potential of being a
>  JVM, not Tomcat, problem.  The value of the aforementioned system
>  property should tell us which.)

1.6.0_03

In the code for CGIServelet.java there is no check for "windows vista"

I have passShellEnvironment set to true as it's required for the scripts to run.

Regards,
Patrick

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Unable to read shell environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Patrick Lee [mailto:patrick@horologe.com.au] 
> Subject: Unable to read shell environment variables
> 
> It looks like getShellEnvironment() is testing for specific versions
> of Windows and 2008 is not one of them, then defaulting to the unix
> call and throwing the "Cannot run program env" error.

When running a Java program under Win2008, what value does the system
property os.name have?

What JVM version are you running?  (This has the potential of being a
JVM, not Tomcat, problem.  The value of the aforementioned system
property should tell us which.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org