Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9255603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:45:02+00:00 2026-06-18T11:45:02+00:00

I am trying to execute a jar file to do a simple query on

  • 0

I am trying to execute a jar file to do a simple query on my HBase database, from a PHP Server, so i can print the results to a webpage.

PHP Server in configured with same username as hadoop user, and same group too.

The PHP exec command is:

exec("bash /usr/local/hadoop/bin/hadoop  jar myjar.jar my.package.MyClass   2> php_error.log", $result);

I get this exception when i try to exec the command(in the php_error.log):

Exception in thread "main" java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(File.java:1879)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:115)

I know its related to permissions, but even with 777 on my HDFS, and on hadoop installation folders, it doesnt work.

Any ideas? Thank you.

Also, where this temp file wants to be created?
Hadoop dir? hdfs? Where?

Edit:
running this locally, it works perfectly! no permission errors!
hadoop jar myjar.jar my.package.MyClass

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:45:03+00:00Added an answer on June 18, 2026 at 11:45 am

    Your PHP is ok. The problem is, that the command you are running is trying to copy the file to the hadoop.tmp.dir. It’s default location is /tmp/hadoop-${user.name}. You have to give the permissions to that folder too, or the full /tmp/hadoop directory recursively

    Edit:

    Figured out that apache isn’t a valid user in that case. The solution is to create a new user, add it to hadoop group, set permissions to jar, and hadoop.tmp.dir and change the webpage owner to the created user

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to read database scripts in a Jar file so that I
I'm trying to execute the following line of code: subprocess.call([java, -cp, /home/me/somepath/file.jar, ..., -someflag
I'm trying to execute a java program to sign a pdf file with php
I'm trying to execute a jar file and when I do it I have
I am trying to execute a local executable jar from an html page, so
I am trying to package a simple JRuby script into a jar file. The
Hi All I'm trying to run a jar a file from MSSQL stored procedure.
Im trying to execute a .bat file remotely in a powershell script. The code
I`m trying to execute linux commant 'cat' from java code, but it does not
I'm trying to execute a PowerShell script from a c# application. The script has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.