runing shell command inside java action on Oozie throws Permission deniedHadoop Streaming in .NETError while executing Java code in RFTwhat this exception means in oracle jaxd-ws soap web serviceHive Metastore Sql server :thrift.transport.TTransportException: No keytab specifiedHow to implement curl(POST the json file) using javaError in sqoop action in oozie while fetching data from teradata to hiveI have been trying to run selenium basic test in itelliJ and I am getting the following errorNoclassDefFoundError with MavenGSON: java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to My Generic ClassOozie Spark access to hive with kerberos

Can you use Vicious Mockery to win an argument or gain favours?

How can ping know if my host is down

How could a planet have erratic days?

Can I say "fingers" when referring to toes?

What is the English pronunciation of "pain au chocolat"?

Has any country ever had 2 former presidents in jail simultaneously?

Delete multiple columns using awk or sed

Does Doodling or Improvising on the Piano Have Any Benefits?

"It doesn't matter" or "it won't matter"?

Review your own paper in Mathematics

Does the Linux kernel need a file system to run?

US tourist/student visa

It grows, but water kills it

Pre-mixing cryogenic fuels and using only one fuel tank

Creating two special characters

Why do ¬, ∀ and ∃ have the same precedence?

How to get directions in deep space?

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

How do I tell my boss that I'm quitting soon, especially given that a colleague just left this week

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

Does "he squandered his car on drink" sound natural?

Can I cause damage to electrical appliances by unplugging them when they are turned on?

When were female captains banned from Starfleet?



runing shell command inside java action on Oozie throws Permission denied


Hadoop Streaming in .NETError while executing Java code in RFTwhat this exception means in oracle jaxd-ws soap web serviceHive Metastore Sql server :thrift.transport.TTransportException: No keytab specifiedHow to implement curl(POST the json file) using javaError in sqoop action in oozie while fetching data from teradata to hiveI have been trying to run selenium basic test in itelliJ and I am getting the following errorNoclassDefFoundError with MavenGSON: java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to My Generic ClassOozie Spark access to hive with kerberos













0















I have this java code



public static void main(String... args) throws IOException, InterruptedException 
execute("echo "Amer"");


private static void execute(String command) throws IOException, InterruptedException
ProcessBuilder builder = new ProcessBuilder();
builder.command(command);
//builder.directory(new File(System.getProperty("user.home")));
Process process = builder.start();

StreamGobbler streamGobbler =
new StreamGobbler(process.getInputStream(), System.out::println);
Executors.newSingleThreadExecutor().submit(streamGobbler);
int exitCode = process.waitFor();
assert exitCode == 0;



and I am trying to run it on a Oozie workflow via java action
but when i submit the workflow, it's killed with the following exception (java.io.IOException: error=13, Permission denied)




org.apache.oozie.action.hadoop.JavaMainException: java.io.IOException:
Cannot run program "echo "Amer"": error=13, Permission denied at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:60) at
org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:78)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:231)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:465) at
org.apache.hadoop.mapred.MapTask.run(MapTask.java:349) at
org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174) at
java.security.AccessController.doPrivileged(Native Method) at
javax.security.auth.Subject.doAs(Subject.java:422) at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1688)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168) Caused
by: java.io.IOException: Cannot run program "echo "Amer"": error=13,
Permission denied at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
ShellCommandExecutor.execute(ShellCommandExecutor.java:18) at
ShellCommandExecutor.main(ShellCommandExecutor.java:11) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:57) ... 15
more Caused by: java.io.IOException: error=13, Permission denied at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:247) at
java.lang.ProcessImpl.start(ProcessImpl.java:134) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 22 more




any hint ?










share|improve this question



















  • 1





    builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

    – that other guy
    Mar 7 at 23:56












  • thank you so much , it works !!

    – Amer Abu Hassan
    Mar 8 at 0:00















0















I have this java code



public static void main(String... args) throws IOException, InterruptedException 
execute("echo "Amer"");


private static void execute(String command) throws IOException, InterruptedException
ProcessBuilder builder = new ProcessBuilder();
builder.command(command);
//builder.directory(new File(System.getProperty("user.home")));
Process process = builder.start();

StreamGobbler streamGobbler =
new StreamGobbler(process.getInputStream(), System.out::println);
Executors.newSingleThreadExecutor().submit(streamGobbler);
int exitCode = process.waitFor();
assert exitCode == 0;



and I am trying to run it on a Oozie workflow via java action
but when i submit the workflow, it's killed with the following exception (java.io.IOException: error=13, Permission denied)




org.apache.oozie.action.hadoop.JavaMainException: java.io.IOException:
Cannot run program "echo "Amer"": error=13, Permission denied at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:60) at
org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:78)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:231)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:465) at
org.apache.hadoop.mapred.MapTask.run(MapTask.java:349) at
org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174) at
java.security.AccessController.doPrivileged(Native Method) at
javax.security.auth.Subject.doAs(Subject.java:422) at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1688)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168) Caused
by: java.io.IOException: Cannot run program "echo "Amer"": error=13,
Permission denied at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
ShellCommandExecutor.execute(ShellCommandExecutor.java:18) at
ShellCommandExecutor.main(ShellCommandExecutor.java:11) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:57) ... 15
more Caused by: java.io.IOException: error=13, Permission denied at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:247) at
java.lang.ProcessImpl.start(ProcessImpl.java:134) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 22 more




any hint ?










share|improve this question



















  • 1





    builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

    – that other guy
    Mar 7 at 23:56












  • thank you so much , it works !!

    – Amer Abu Hassan
    Mar 8 at 0:00













0












0








0








I have this java code



public static void main(String... args) throws IOException, InterruptedException 
execute("echo "Amer"");


private static void execute(String command) throws IOException, InterruptedException
ProcessBuilder builder = new ProcessBuilder();
builder.command(command);
//builder.directory(new File(System.getProperty("user.home")));
Process process = builder.start();

StreamGobbler streamGobbler =
new StreamGobbler(process.getInputStream(), System.out::println);
Executors.newSingleThreadExecutor().submit(streamGobbler);
int exitCode = process.waitFor();
assert exitCode == 0;



and I am trying to run it on a Oozie workflow via java action
but when i submit the workflow, it's killed with the following exception (java.io.IOException: error=13, Permission denied)




org.apache.oozie.action.hadoop.JavaMainException: java.io.IOException:
Cannot run program "echo "Amer"": error=13, Permission denied at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:60) at
org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:78)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:231)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:465) at
org.apache.hadoop.mapred.MapTask.run(MapTask.java:349) at
org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174) at
java.security.AccessController.doPrivileged(Native Method) at
javax.security.auth.Subject.doAs(Subject.java:422) at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1688)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168) Caused
by: java.io.IOException: Cannot run program "echo "Amer"": error=13,
Permission denied at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
ShellCommandExecutor.execute(ShellCommandExecutor.java:18) at
ShellCommandExecutor.main(ShellCommandExecutor.java:11) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:57) ... 15
more Caused by: java.io.IOException: error=13, Permission denied at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:247) at
java.lang.ProcessImpl.start(ProcessImpl.java:134) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 22 more




any hint ?










share|improve this question
















I have this java code



public static void main(String... args) throws IOException, InterruptedException 
execute("echo "Amer"");


private static void execute(String command) throws IOException, InterruptedException
ProcessBuilder builder = new ProcessBuilder();
builder.command(command);
//builder.directory(new File(System.getProperty("user.home")));
Process process = builder.start();

StreamGobbler streamGobbler =
new StreamGobbler(process.getInputStream(), System.out::println);
Executors.newSingleThreadExecutor().submit(streamGobbler);
int exitCode = process.waitFor();
assert exitCode == 0;



and I am trying to run it on a Oozie workflow via java action
but when i submit the workflow, it's killed with the following exception (java.io.IOException: error=13, Permission denied)




org.apache.oozie.action.hadoop.JavaMainException: java.io.IOException:
Cannot run program "echo "Amer"": error=13, Permission denied at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:60) at
org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:78)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:231)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:465) at
org.apache.hadoop.mapred.MapTask.run(MapTask.java:349) at
org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:174) at
java.security.AccessController.doPrivileged(Native Method) at
javax.security.auth.Subject.doAs(Subject.java:422) at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1688)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:168) Caused
by: java.io.IOException: Cannot run program "echo "Amer"": error=13,
Permission denied at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
ShellCommandExecutor.execute(ShellCommandExecutor.java:18) at
ShellCommandExecutor.main(ShellCommandExecutor.java:11) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:57) ... 15
more Caused by: java.io.IOException: error=13, Permission denied at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:247) at
java.lang.ProcessImpl.start(ProcessImpl.java:134) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 22 more




any hint ?







java shell hadoop bigdata oozie






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 9:09









danielsepulvedab

4961716




4961716










asked Mar 7 at 23:55









Amer Abu HassanAmer Abu Hassan

1




1







  • 1





    builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

    – that other guy
    Mar 7 at 23:56












  • thank you so much , it works !!

    – Amer Abu Hassan
    Mar 8 at 0:00












  • 1





    builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

    – that other guy
    Mar 7 at 23:56












  • thank you so much , it works !!

    – Amer Abu Hassan
    Mar 8 at 0:00







1




1





builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

– that other guy
Mar 7 at 23:56






builder.command("sh", "-c", command); if you want to run a shell command instead of a program with an argument array

– that other guy
Mar 7 at 23:56














thank you so much , it works !!

– Amer Abu Hassan
Mar 8 at 0:00





thank you so much , it works !!

– Amer Abu Hassan
Mar 8 at 0:00












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054700%2fruning-shell-command-inside-java-action-on-oozie-throws-permission-denied%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054700%2fruning-shell-command-inside-java-action-on-oozie-throws-permission-denied%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived