This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes File permissions and Process.exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "File permissions and Process.exec()" Watch "File permissions and Process.exec()" New topic
Author

File permissions and Process.exec()

Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I've got a batch processing task running on a timer as part of my J2EE application on WebLogic 8.1 and I'm experiencing problems with invoking Process#exec().

To be more accurate, this is what I'm trying to do:


Now, this piece of code works perfectly when run manually ("java Move foo.txt bar.txt") but when it's run within the J2EE application -- as the same user as in the manual case -- the file's won't get moved anywhere.

I suppose it's a permission/policy issue. If that's the case, how should I edit the policy file?

I already tried to add the following lines to weblogic.policy:

...but that didn't seem to help at all.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
FYI, the problem went away once I read the stderr and stdout streams from the Process. Any idea why this works?
Guy Belpa
Ranch Hand

Joined: Nov 21, 2004
Posts: 41
Lasse Koskela wrote:FYI, the problem went away once I read the stderr and stdout streams from the Process. Any idea why this works?


how did you do that?
please explain. Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File permissions and Process.exec()