Installing proto3 for java: package com.google.protobuf.DescriptorProtos does not exist

2,093 views
Skip to first unread message

Joris Peeters

unread,
Jan 12, 2016, 1:51:23 PM1/12/16
to Protocol Buffers

I have installed proto3 from yesterday's master and it all seems to work fine. Also managed to get it to work with python without too much trouble. I am running on Windows.

I am now following the instructions in protobuf/java, though, and am running into the following error:

 

C:\coding\proto\protobuf\java>mvn test

[INFO] Scanning for projects...

[WARNING]

[WARNING] Some problems were encountered while building the effective model for com.google.protobuf:protobuf-java:bundle:3.0.0-beta-2

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 57, column 15

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 64, column 15

[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ line 162, column 15

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING]

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building Protocol Buffer Java API 3.0.0-beta-2

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-antrun-plugin:1.3:run (generate-sources) @ protobuf-java ---

[INFO] Executing tasks

     [exec] protoc:./.libs/lt-protoc.c:233: FATAL: couldn't find ..\src\protoc.

     [exec] Result: 1

[INFO] Executed tasks

[INFO] Registering compile source root C:\coding\proto\protobuf\java\target\generated-sources

[INFO]

[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ protobuf-java ---

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 12 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ protobuf-java ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!

[INFO] Compiling 66 source files to C:\coding\proto\protobuf\java\target\classes

[INFO] /C:/coding/proto/protobuf/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java: Some input files use unchecked or unsafe operations.

[INFO] /C:/coding/proto/protobuf/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java: Recompile with -Xlint:unchecked for details.

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] /C:/coding/proto/protobuf/java/src/main/java/com/google/protobuf/Descriptors.java:[33,1] package com.google.protobuf.DescriptorProtos does not exist

[ERROR] /C:/coding/proto/protobuf/java/src/main/java/com/google/protobuf/Descriptors.java:[77,12] cannot find symbol

  symbol:   class FileDescriptorProto

  location: class com.google.protobuf.Descriptors.FileDescriptor

..

(and then a lot more similar failures).

 

Has anyone seen that before? A quick look around (stackoverflow etc) did not come up with any hits, but I apologise in advance if this was a well-known problem that I could have easily fixed myself.

 

Thanks,

-J

 

Joris Peeters

unread,
Jan 12, 2016, 1:51:23 PM1/12/16
to Protocol Buffers

Has anyone seen that before? Any things I could check? A quick look around (stackoverflow etc) did not come up with any hits, but I apologise in advance if this was a well-known problem that I could have easily fixed myself.

 

Thanks,

-J

Feng Xiao

unread,
Jan 12, 2016, 5:57:56 PM1/12/16
to Joris Peeters, Protocol Buffers
Hi Joris,

If you want to use protobuf Java, you don't need to build it by yourself. Instead just simply declare a dependency on the protobuf java artifact in your pom file or gradle file. See: 

If for some reason you need to build it from source, you need to compile the protoc first and make sure it's working.

On Tue, Jan 5, 2016 at 9:22 AM, Joris Peeters <joris.mg...@gmail.com> wrote:

I have installed proto3 from yesterday's master and it all seems to work fine. Also managed to get it to work with python without too much trouble. I am running on Windows.

I am now following the instructions in protobuf/java, though, and am running into the following error:

 

C:\coding\proto\protobuf\java>mvn test

[INFO] Scanning for projects...

[WARNING]

[WARNING] Some problems were encountered while building the effective model for com.google.protobuf:protobuf-java:bundle:3.0.0-beta-2

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 57, column 15

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 64, column 15

[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ line 162, column 15

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING]

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building Protocol Buffer Java API 3.0.0-beta-2

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-antrun-plugin:1.3:run (generate-sources) @ protobuf-java ---

[INFO] Executing tasks

     [exec] protoc:./.libs/lt-protoc.c:233: FATAL: couldn't find ..\src\protoc.

     [exec] Result: 1

How did you build the protoc binary? Could you try to use the protoc in our release download page:

Look for the protoc-3.0.0-beta-2-win32.zip file in the downloads section.
 

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages