www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nitin More <nitinm...@yahoo.com>
Subject mod_jserv/5666: Can't use Runtime.exec() on NT
Date Fri, 28 Jan 2000 20:57:31 GMT

>Number:         5666
>Category:       mod_jserv
>Synopsis:       Can't use Runtime.exec() on NT
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Jan 28 13:00:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     nitinmore@yahoo.com
>Release:        1.3.6
>Organization:
apache
>Environment:
Win NT 4.0, latest JServ, JDK 1.1.7B
>Description:

I need a way to get the environment variable in my Java servlets.  
How can I do that?  I tried calling "env <varname>" in Runtime.exec().
Is there a better alternative?

The following code results in an exception:
   Runtime runtime = Runtime.getRuntime();
   Process process = runtime.exec(cmd);

The Java exception:
java.io.IOException: CreateProcess: env error=2
	at java.lang.Win32Process.<init>(Compiled Code)
	at java.lang.Runtime.exec(Compiled Code)
	at java.lang.Runtime.exec(Runtime.java:129)
	at com.iown.utility.Utility.getenv(Compiled Code)
	at com.iown.utility.Utility.getEnvironmentName(Utility.java:109)
	at com.iown.utility.AppContext.setupLogFile(AppContext.java:310)
	at com.iown.utility.AppContext.init(AppContext.java:201)
	at com.iown.utility.BaseServlet.initAppContext(BaseServlet.java:116)
	at com.iown.utility.BaseServlet.init(BaseServlet.java:101)
	at com.iown.login.LoginBaseServlet.init(LoginBaseServlet.java:62)
	at LoginServlet.init(LoginServlet.java:57)
	at org.apache.jserv.JServServletManager.load_init(JServServletManager.java:569)
	at org.apache.jserv.JServServletManager.loadServlet(JServServletManager.java:488)
	at org.apache.jserv.JServConnection.processRequest(JServConnection.java:266)
	at org.apache.jserv.JServConnection.run(JServConnection.java:188)
	at java.lang.Thread.run(Thread.java:466)
>How-To-Repeat:
   Runtime runtime = Runtime.getRuntime();
   Process process = runtime.exec(cmd);
>Fix:
None
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
 
 


Mime
View raw message