You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Carmen Manzulli <ca...@gmail.com> on 2015/02/27 11:36:16 UTC
java.lang.InstantiationException
Hi experts,
i'm Carmen and i'm trying to write a simple class which submit a Job,
having a jena-elephas mapper and input and output formats, in to my hadoop
cluster with only one master and one slave, but i get this error:
java.lang.RuntimeException: java.lang.InstantiationException
at
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
at
org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:559)
at
org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:432)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1296)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1293)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1293)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1314)
at
com.sisinflab.prova.RDFMapReduceExample.main(RDFMapReduceExample.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.InstantiationException
at
sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
... 16 more
when I execute this command
bin/hadoop jar
/home/sisinflab/NetBeansProjects/prova/target/prova-1.0-SNAPSHOT-jar-with-dependencies.jar
com.sisinflab.prova.RDFMapReduceExample -input /input/persondata.ttl
-output /output/
this is my source code:
public class RDFMapReduceExample {
public static void main(String[] args) {
try{
// Configuration processed by ToolRunner
Configuration conf = new Configuration();
conf.addResource(new
Path("/usr/local/hadoop/etc/hadoop/core-site.xml"));
conf.addResource(new
Path("/usr/local/hadoop/etc/hadoop/hdfs-site.xml"));
conf.addResource(new
Path("/usr/local/hadoop/etc/hadoop/yarn-site.xml"));
conf.addResource(new
Path("/usr/local/hadoop/etc/hadoop/mapred-site.xml"));
conf.set("mapred.job.tracker","hdfs://master:54311");
conf.set("fs.defaultFS", "hdfs://master:54310");
conf.set(RdfMapReduceConstants.FILTER_SUBJECT_URIS,"
http://dbpedia.org/resource/Alfred_Hitchcock");
// Create a Job using conf
Job job =Job.getInstance(conf, "rdfexample");
job.setJarByClass(RDFMapReduceExample.class);
// Specify various job-specific parameters
job.setMapperClass(TripleFilterBySubjectUriMapper.class);
job.setOutputValueClass(TripleWritable.class);
job.setOutputKeyClass(IntWritable.class);
job.setInputFormatClass(TriplesInputFormat.class);
job.setOutputFormatClass(TriplesOrQuadsOutputFormat.class);
FileInputFormat.setInputPaths(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
// Submit the job, then poll for progress until the job is complete
job.waitForCompletion(true);
}catch(Throwable e){
e.printStackTrace();
}}
}
I would like to understand what could be the reason of my error...
thanks in advance,
Carmen.