3

I am now trying to build hadoop using mvn after I finished its prerequisites. However, I get this message even though I have right version of protoc. I tried to rebuild protoc 2.5.0 several times already and every time all the tests of it would be passed and build successfully. I don't know why this keeps happening, Please help. Thanks.

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc failure -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :hadoop-common

TJ@DESKTOP-6940Q5M /cygdrive/e/hdc $ protoc --version libprotoc 2.5.0

Thanks for the advice that I missed to upload the display on the re-run with -e switch. Here it is.

Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc failure -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc failure at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.maven.plugin.MojoExecutionException: protoc failure at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:105) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: org.apache.maven.plugin.MojoExecutionException: protoc failure at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:102) ... 22 more

I really don't know what its problem is since I am a starter with hadoop. Please help.

TaeJun Lee
  • 31
  • 4
  • So, what is the actual error? Apart from "protoc failure" there are no meaningful messages. Could you try running maven with those -e and -X switches to get more info? – facha Feb 03 '16 at 11:42
  • Thank you for your comment. I have debugged with -e switch again and got the result like I have added to my post. I have no idea what the problems is. Please help. – TaeJun Lee Feb 04 '16 at 00:25

2 Answers2

2

The hadoop maven protobuf compiler is, sadly, useless when there's an error.

This could just be some error in the .protoc files which isn't being reported as such, instead mvn is just failing without showing the root cause.

I end up debugging compilation problems by using the protoc command line tool.

stevel
  • 12,567
  • 1
  • 39
  • 50
1

Seems you need to install protobuf-compiler. Then build hadoop-maven-plugins. The go back to hadoop source code parent directory and execute maven goal

cd <hadoop_source_path>
sudo yum install protobuf-compiler
cd hadoop-maven-plugins
mvn install
cd ..
mvn package -skipTests

This worked for me.

Suraj Nayak
  • 907
  • 1
  • 8
  • 24