Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running embedded Jaql using hadoop jar results in IllegalAccessException #100

Open
GoogleCodeExporter opened this issue Feb 14, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Write a simple Embedded Jaql program, resulting in a M/R job, e.g.:

public static void main(String[] args) throws Exception {

JaqlQuery q = new JaqlQuery("[1,2,3,4,5]->write({type:\"hdfs\", 
location:\"out.json\"});");
q.evaluate();
q.close();

}

2. Pack the program as a fatjar (i.e. containing the JAQL references directly).

3. Run the fatjar using: hadoop jar <fatjar>.

What is the expected output? What do you see instead?
The expected output would be a successul write to HDFS, instead I receive a 
IllegalAccessException (see attachment).


What version of the product are you using? On what operating system?
Jaql 0.5.1 on Hadoop 0.20.2 on Ubuntu x64 10.10  

Please provide any additional information below.
The error is caused by two things:
1) Jaql class "org.apache.hadoop.mapred.ExposeJobContext" calls a constroctur 
of Hadoop class "org.apache.hadoop.mapred.JobContext" which is only package 
visible.
2) Hadoop RunJar loads provided user classes with a different Classloader than 
Hadoop classes.
3) Since "org.apache.hadoop.mapred.JobContext" and 
"org.apache.hadoop.mapred.ExposeJobContext" are loaded by two different 
Classloaders, the JVM does not see them as being within the same package. Thus 
the call to the JobContext constructor raises an IllegalAccessException.

Original issue reported on code.google.com by [email protected] on 25 Jan 2011 at 5:44

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant