Question

I'm altering a hadoop map - reduce job that currently compiles and runs fine without my changes.

As part of the job, I will now be connecting to S3 to deliver a file.

I developed a (very simple) s3Connector class, tested and ran it in eclipse, then went to hook it into my reduce job. In order to run the job in hadoop, I have to export the project as a jar file, then call it from hadoop. The jar file seems to compile and export without problem from eclipse, but when I run it in hadoop, I get a java.lang.VerifyError exception.

java.lang.VerifyError: (class: com/extrabux/services/S3Connector, method: 
connectToS3 signature: ()V) Incompatible argument to function

Several other posts mention that there may be jar version dependencies that are conflicting, but in my eclipse build path, I added all the latest jar files for the specified libs, and pushed them to the top of the build path order.

This is about as simple as I can isolate it down to:

import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.security.AWSCredentials;

public class S3Connector {

protected RestS3Service s3Service;
protected AWSCredentials awsCredentials;


public S3Connector()
{
    this.awsCredentials= new AWSCredentials("my secret 1", "my secret 2");
}


public void connectToS3() throws Exception
{
    this.s3Service = new RestS3Service(this.awsCredentials);
}  

}

Even that simple class will die.. Same message. As soon as I comment out the AWS credentials in the constructor and RestS3Service, the issue disappears. Basically, I think it's some kind of library export problem out of eclipse, but not sure how to find it.

Was it helpful?

Solution

Figured this out. There was an old version of the jets3t jar that was in the hadoop lib dir

the hadoop command line script loops over all jars in the lib dir and physically adds them to the classpath on the final exec'ed command line command that it builds. This command line classpath of the 0.6.0 jar was overriding the good 0.8.0 jar that I was exporting in my jar file. Since the 0.6.0 version did not have the specified constructor for RestS3Service , the java.lang.VerifyError was getting thrown. By removing the 0.6.0 lib from hadoop, all was well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top