Dgraph4j dependency problems

(Dx Guan) #1

I use dgrah4j in maven:


However, a error raises while I tried to do a mvn compile and the error messages are mainly like this:

cannot access com.google.protobuf.GeneratedMessageV3
class file for com.google.protobuf.GeneratedMessageV3 not found

Seems like the compiler cannot find this class file GeneratedMessageV3 which should be in this library:


After diving into the dependency tree, I found that this library: grpc-protobuf which is depended by dgraph4j has explicitly exclude the library: protobuf-java:

    // the other exclusions

Therefore, is it necessary for dgraph4j to explicitly depends on the 3.*.* version of protobuf-java library?

Otherwise, the users(like me) of dgraph4j have to depend on the library above in our project explicitly and seems like a little bit weird.

(Daniel Mai) #2

@deepak Any ideas about this?

(Deepak Jois) #3


Here is the gradle file from the dgraph4j repository for a sample app: https://github.com/dgraph-io/dgraph4j/blob/master/samples/DgraphJavaSample/build.gradle

The dependency is specified as below:

dependencies {
 	// Use Dgraph Java client
 	compile 'io.dgraph:dgraph4j:1.5.0'

    // Use JUnit test framework
    testCompile 'junit:junit:4.12'

This seems to be enough to compile the sample app without any problem. I am trying to figure out how your code may be different from the sample code to reveal this issue. Is it possible to post a minimum working example that demonstrates the problem?

In the meanwhile, I will try by building a sample app that uses maven directly instead of gradle and see if that reproduces the issue.