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

  • Home
  • SEARCH
  • 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 8246759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:36:43+00:00 2026-06-07T22:36:43+00:00

In my mapper code I am using a 3rd party library of JTS.jar. I

  • 0

In my mapper code I am using a 3rd party library of JTS.jar. I need to put it on the distributed cache of hadoop so that all nodes can access it. I found at this link that -libjars can be used to do this.

I now execute my code using

hadoop jar -libjars JTS.jar my_jar.jar classname inputFiles outputFiles.

but this doesn’t work. Any suggestion on how to fix this?

  • 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-07T22:36:46+00:00Added an answer on June 7, 2026 at 10:36 pm

    In a different effort, I tried to follow this link.

    1) I copied the Jar library to hadoop using:

    hadoop fs -copyFromLocal JTS.jar /someHadoopFolder/JTS.jar
    

    2) I then modified my Configuration as below:

            Configuration conf = new Configuration();
    
        Job job = new Job(conf);
        job.setJobName("TEST JOB");
    
        List<String> other_args = parseArguments(args, job);
    
        DistributedCache.addFileToClassPath(new Path("/someHadoopFolder/JTS.jar"), conf);
    
        job.setMapOutputKeyClass(LongWritable.class);
        job.setMapOutputValueClass(Text.class);
    
        job.setOutputKeyClass(LongWritable.class);
        job.setOutputValueClass(Text.class);
    
        job.setMapperClass(myMapper.class);
        //job.setCombinerClass(myReducer.class);
        //job.setReducerClass(myReducer.class);
    
        job.setInputFormatClass(TextInputFormat.class);   
        job.setOutputFormatClass(TextOutputFormat.class);
    
    
        String inPath = other_args.get(0);
        String outPath = other_args.get(1);     
        TextInputFormat.setInputPaths(job, inPath);
        TextOutputFormat.setOutputPath(job, new Path(outPath));
    
        TextInputFormat.setMinInputSplitSize(job, 32 * MEGABYTES);
        TextInputFormat.setMaxInputSplitSize(job, 32 * MEGABYTES);
    
        job.setJarByClass(myFile.class);
    
        job.waitForCompletion(true);
    

    3) The tutorial then says “Use the cached file in mapper” so my mapper looks like this:

        public static class myMapper extends Mapper<LongWritable, Text, LongWritable, Text>{
           private Path[] localArchives;
           private Path[] localFiles;
    
           public void configure(Configuration conf) throws IOException {
             localArchives = DistributedCache.getLocalCacheArchives(conf);
             localFiles = DistributedCache.getLocalCacheFiles(conf);
           }
    
    
    
        public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException{
                //ENVELOPE IS FROM THE JTS.JAR library
            Envelope e1 = new Envelope(-180, 85, 180, -85);
                context.write(key, value);
    
        }
    
    }
    

    Despite doing all these, The code still fails by throwing “Class bout found”. Any help?

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

Sidebar

Related Questions

I have the following code that downloads an object from a 3rd party and
I'm using the WindowsMedia library found here: http://www.ernzo.com/soundstudio.aspx The sample code had the ability
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
For the following two lines of C++ code map<string, vector<size_t> >::iterator beg = mapper.begin();
The following code defines a sequence of names that are mapped to numbers. It
I am using Dozer mapper to map Service objects to Value objects. I am
Is there an OR/M (object relational mapper) that can be used in Classic ASP?
this time someone should please relpy i am struggling with running my code using
I'm using NHibernate mapping by code and I'm creating the session factory in this

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.