stealthly / f2k

File Loader to Kafka
Apache License 2.0
7 stars 2 forks source link

Build Failed #1

Open alajangi opened 9 years ago

alajangi commented 9 years ago

Hi,

I am cloned this repo with

git clone https://github.com/stealthly/f2k.git

cd f2k

when I run .

./gradlew clean fatJar

the error is "Execution failed for task ':compileProto'."

when I run with --debug option it gives the info

Gradle user home: /root/.gradle Current dir: /root/f2k java.io.IOException: Cannot run program "/usr/bin/protoc" (in directory "/root/f2k"): error=2, No such file or directory

but when I run from /root

./f2k/gradlew clean fatJar --stacktrace

the error is "Task 'clean' not found in root project 'root'."

Please help me how to build this.

Thanks.

joestein commented 9 years ago

In that project the protobuf https://github.com/stealthly/f2k/blob/master/src/main/proto/FileType.proto is compiled/generated in the gradle task using the plugin https://github.com/stealthly/f2k/blob/master/build.gradle#L17

You need to have protobuf https://github.com/google/protobuf/ installed and have it setup for your environment appropriately (see protoBuf {} gradle task in build.gradle https://github.com/stealthly/f2k/blob/master/build.gradle#L19-L24 )

The README should get updated and we should have a vagrant up (or docker) implementation so it works right from the repo better without having to-do much local for others so they don't bump into this and then work around it locally by installing protobuf.

alajangi commented 9 years ago

Hi joestein, After I installed protoc when I run ./gradlew clean fatJar I am getting the compileJava error, see the below output and suggest me the next step. f2k]# ./gradlew clean fatJar Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties. Deprecated dynamic property: "mainClassName" on "root project 'f2k'", value: "ly.stealth.f2k.Main". The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead. :cleanProto :clean :compileProto Compiling FileType.proto for Linux /usr/local/bin/protoc -I=/root/f2k/src/main/proto --java_out=src/main/java /root/f2k/src/main/proto/FileType.proto :compileJava /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:105: error: cannot find symbol public static com.google.protobuf.Parser PARSER = ^ symbol: class Parser location: package com.google.protobuf /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:116: error: cannot find symbol public com.google.protobuf.Parser getParserForType() { ^ symbol: class Parser location: package com.google.protobuf /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:50: error: getUnknownFields() in FileType cannot override getUnknownFields() in GeneratedMessage getUnknownFields() { ^ overridden method is final /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:70: error: cannot find symbol if (!parseUnknownField(input, unknownFields, ^ symbol: method parseUnknownField(CodedInputStream,Builder,ExtensionRegistryLite,int) location: class FileType /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:84: error: cannot find symbol throw e.setUnfinishedMessage(this); ^ symbol: method setUnfinishedMessage(FileType) location: variable e of type InvalidProtocolBufferException /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:87: error: cannot find symbol e.getMessage()).setUnfinishedMessage(this); ^ symbol: method setUnfinishedMessage(FileType) location: class InvalidProtocolBufferException /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:90: error: cannot find symbol makeExtensionsImmutable(); ^ symbol: method makeExtensionsImmutable() location: class FileType /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:101: error: cannot find symbol .ensureFieldAccessorsInitialized( ^ symbol: method ensureFieldAccessorsInitialized(Class,Class) location: variable internal_static_FileType_fieldAccessorTable of type FieldAccessorTable /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:106: error: cannot find symbol new com.google.protobuf.AbstractParser() { ^ symbol: class AbstractParser location: package com.google.protobuf /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:115: error: method does not override or implement a method from a supertype @java.lang.Override ^ /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:261: error: cannot find symbol .ensureFieldAccessorsInitialized( ^ symbol: method ensureFieldAccessorsInitialized(Class,Class) location: variable internal_static_FileType_fieldAccessorTable of type FieldAccessorTable /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:354: error: cannot find symbol parsedMessage = (ly.stealth.f2k.FileTypes.FileType) e.getUnfinishedMessage(); ^ symbol: method getUnfinishedMessage() location: variable e of type InvalidProtocolBufferException /root/f2k/src/main/java/ly/stealth/f2k/FileTypes.java:442: error: constructor FieldAccessorTable in class FieldAccessorTable cannot be applied to given types; internal_static_FileType_fieldAccessorTable = new ^ required: Descriptor,String[],Class<? extends GeneratedMessage>,Class<? extends Builder> found: Descriptor,String[] reason: actual and formal argument lists differ in length 13 errors :compileJava FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 4.907 secs

Thanks.