RE: Using java.io in WebObjects in deployment...???
RE: Using java.io in WebObjects in deployment...???
- Subject: RE: Using java.io in WebObjects in deployment...???
- From: Andy Beier <email@hidden>
- Date: Thu, 10 Feb 2005 13:37:49 -0700
- Thread-topic: Using java.io in WebObjects in deployment...???
Having run into this problem myself, one option is to add the uid
WebObjects runs under (appserve) to the groups that have write
permission to the folders you're trying to write to. You can also set
your specific application to run under root by setting what is called
the Sticky Bits. chmod u+S <App Shell Script> please keep in mind that
this is as about as advisable as running WO under root. The only benefit
with sticky bits is wotaskd and monitor are not running as root but now
you have to be certain that no one that you don't want to have root
privileges on that machine can write to that shell script.
Good luck!
Andy
-----Original Message-----
From: webobjects-dev-bounces+abeier=email@hidden
[mailto:webobjects-dev-bounces+abeier=email@hidden] On Behalf
Of Doug Andrews
Sent: Thursday, February 10, 2005 1:18 PM
To: Robert Walker
Cc: email@hidden
Subject: Re: Using java.io in WebObjects in deployment...???
You'll need to be writing your file somewhere where "appserver" has
permissions to do so.
If you absolutely need to run as root in deployment (which is not
recommended), then change the group to "wheel" and the user to "System"
on the following two files:
/System/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd
/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/
Resources/javawoservice.sh
On Feb 10, 2005, at 11:52 AM, Robert Walker wrote:
> WebObjects deployment does not run as root to my understanding. I
> believe it runs as appserver user.
>
> On Feb 9, 2005, at 6:34 PM, Clint Fleetwood wrote:
>
>> Can you not properly use the java.io package in WO in a deployment
>> environment because it works perfectly when i build and run in
>> development mode....here's a snippet of what I'm doing; one of my
>> components calls on this class: Everything works fine even the
>> ERXRuntimeUtilites and the writing out of the file in development
>> mode but when I setup the application in JavaMonitor and then hit it
>> on the web. Neither the writing of the file and ERXRuntimeUtilities
>> does ANYTHING ! I don't get it. Does it have something to do with the
>> user that JavaMonitor uses to start up the app because I am running
>> wotaskd and JavaMonitor with the root user but i figured if the app
>> is being run by the root then it CERTAINLY shouldn't have a probelm
>> writing out that file. What's up ?? Also, everything works great if I
>> startup the app from the command line. ONLY when setup through
>> JavaMonitor does it NOT work. ?????
>>
>> import java.util.StringTokenizer;
>> import java.io.*;
>> import com.webobjects.foundation.*;
>> import com.webobjects.eocontrol.*;
>> import er.extensions.*;
>>
>> public class UpdatePti {
>>
>> public static String file="/Volumes/PTI/UPDATE.DAT";
>> public static String completeLine;
>>
>> public void createUpdate(String unitNumberToPTI, Number
>> gateCodePTICollect, String userNameToPTI, String statusToPTI) {
>>
>> String gateCodeToPTI = gateCodePTICollect.toString();
>>
>> try {
>>
>> FileWriter fw = new FileWriter (file);
>> PrintWriter outfile = new PrintWriter (fw);
>>
>> completeLine = unitNumberToPTI + gateCodeToPTI +
userNameToPTI +
>> statusToPTI;
>>
>> System.out.println(completeLine);
>> outfile.println(completeLine);
>> outfile.close();
>> }
>>
>> catch (IOException exception) {
>> System.out.println (exception);
>> }
>>
>> String[] commands = new String[]{"java
RunComClient"};
>> String[] envp = new
String[]{"PATH=/usr/bin"};
>> File dir = new
File("/Users/admin/Documents/RMI");
>>
>> ERXRuntimeUtilities erxRun = new
ERXRuntimeUtilities();
>> try {
>>
>> erxRun.executeCommandLineCommandsWithEnvVarsInWorkingDir(commands,
>> envp, dir);
>> }
>> catch (IOException ioe) {
>> System.out.println("caught at erx
runtime");
>> }
>> }
>>
>> } _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> email@hidden
>>
>> This email sent to email@hidden
> --
> Robert Walker
> Bennett Technology Group
> (770) 957-1866 Ext: 790
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> email@hidden
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden