4

I have been doing my project and all the sudden eclipse started to give this error saying

The type com.google.protobuf.GeneratedMessageV3$Builder cannot be resolved. 

It is indirectly referenced from required .class files where we declare the package. I have tried adding com.google.protobuf-2.4.0.jar to build path but it did not work. Please help and here's the screenshot.

enter image description here

Ruthwik
  • 545
  • 1
  • 8
  • 14
user10037726
  • 41
  • 1
  • 3
  • Class you are using is not in classpath, please try adding into classpath. Also after adding please clean the project (from Project->Clean...). – Rmahajan Jan 12 '19 at 11:05
  • possible duplicate of https://stackoverflow.com/questions/5547162/eclipse-error-indirectly-referenced-from-required-class-files – Rmahajan Jan 12 '19 at 11:06

4 Answers4

2

com.mysql.cj.x.protobuf.MysqlxSql.StmtExecute is not on the classpath so remove this import

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Shahan Mehbub
  • 69
  • 1
  • 4
1

If you are expecting Protobuf generated files to be available, then ensure that you have added the Protobuf library to your project.

Gradle example:

implementation group: 'com.google.protobuf', name: 'protobuf-java', version: googleProtobufVersion

Maven example:

<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-java</artifactId>
    <version>${googleProtobufVersion}</version>
</dependency>
bdetweiler
  • 1,544
  • 1
  • 16
  • 27
0

Not sure if this helps at such a later date. But i also faced something similar.

I found that I imported this by mistake

import com.mysql.cj.x.protobuf.MysqlxDatatypes.Array;

After removing this line, it works fine.

In your case you need to remove the import

com.mysql.cj.x.protobuf.MysqlxSql.StmtExecute

Replace it with the relevant import.

Anamik Adhikary
  • 401
  • 1
  • 8
  • 27
-1

This is due to the missing dependency of gRPC protobuf. Add this dependency to your pom.xml and this should solve your problem.

    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-protobuf</artifactId>
        <version>1.16.1</version>
    </dependency>

Lastly, do maven -> project update

Ruthwik
  • 545
  • 1
  • 8
  • 14