Re: [protobuf] Re: Will ByteSize() return a fixed size for fixed object bype if I upgrade Google Protocol Buffer?

2016-09-26 Thread job4charlie
hi Adam,
many thanks for the clarification and for sure I will stick to fix-sized type. the whole story was: 
- before I write a message to file, I have to write the length of the object first, so I can parse and reconstruct it in memory thru SerializeFromArray(char*, size).
- when I do it, I defined a simple message(containing one single fixed32) to keep track of the length, and you know we must make it a fix-sized type because we have to parse the length itself thru SerializeFromArray which requires a exact correct SIZE!
- so, in my case, I need to tell the size before I parse my size-tracking message before hand in a static way, without breaking my code even
if I got Google Protocolbuf updated someday in the future.
- do you know some good practice to do the serialization? I am not sending and receiving data via network so I do have to keep track of message length myself for every object to be written to the file, and I want both backward and forward compatibility!

thanks and looking forward to hearing form you

all the best,

Charlie Chen,



发自我的小米手机在 Adam Cozzette ,2016年9月26日 下午6:43写道:Yes, in your case the serialized size will remain the same because you are using simple fixed-size fields and always initializing them.There are a few things to watch out for, though:- If you use proto3 syntax, zero-valued fields will be omitted from the serialized output because zero is the default anyway. (But based on your example you're using proto2, so that's not an issue.)- Varints of course will be variable sized, so you will have to avoid those and stick to fixed-size types.- If you parse a message that has any unknown fields then those unknown fields could take up an arbitrary amount of space when you reserialize the message.On Mon, Sep 26, 2016 at 12:06 PM,   wrote:在 2016年9月26日星期一 UTC-4下午2:57:14,job4c...@gmail.com写道:Will Google Protocol Buffer ensure this? This is a very important I think.Notes: My message only uses fixed32 and all fields are initialized(values might vary)Message test_msg{optional fixed32 field1 = 1;optional fixed32 field2 = 2;}test_msg msg;msg.set_field1(0);msg.set_field2(1);int size = msg.ByteSize(); // will this be a fixed length even if I upgrade Google Protocol Buffer? 



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.





-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Will ByteSize() return a fixed size for fixed object bype if I upgrade Google Protocol Buffer?

2016-09-26 Thread 'Adam Cozzette' via Protocol Buffers
Yes, in your case the serialized size will remain the same because you are
using simple fixed-size fields and always initializing them.

There are a few things to watch out for, though:
- If you use proto3 syntax, zero-valued fields will be omitted from the
serialized output because zero is the default anyway. (But based on your
example you're using proto2, so that's not an issue.)
- Varints of course will be variable sized, so you will have to avoid those
and stick to fixed-size types.
- If you parse a message that has any unknown fields then those unknown
fields could take up an arbitrary amount of space when you reserialize the
message.

On Mon, Sep 26, 2016 at 12:06 PM,  wrote:

>
>
> 在 2016年9月26日星期一 UTC-4下午2:57:14,job4c...@gmail.com写道:
>>
>> Will Google Protocol Buffer ensure this? This is a very important I think.
>>
>
>
> Notes: My message only uses fixed32 and all fields are initialized(values
> might vary)
>
> Message test_msg
> {
> optional fixed32 field1 = 1;
> optional fixed32 field2 = 2;
> }
>
> test_msg msg;
> msg.set_field1(0);
> msg.set_field2(1);
>
> int size = msg.ByteSize(); // will this be a fixed length even if I
> upgrade Google Protocol Buffer?
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated OuterClass has a lot of incompatibilities !

2016-09-26 Thread Smallufo Huang


OK . I found where goes wrong. 
TIL libphonenumber also dependent on protobuf !
And the project is dependent on an older libphonenumber , not via maven , 
it is via groovy's @Grab !.
That's why mvn's dependency:tree cannot inspect the problem !
And maybe intelliJ regard groovy's @Grab has higher priority.
Anyway , it is fixed. sorry for disturb.



>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Will ByteSize() return a fixed size for fixed object bype if I upgrade Google Protocol Buffer?

2016-09-26 Thread job4charlie


在 2016年9月26日星期一 UTC-4下午2:57:14,job4c...@gmail.com写道:
>
> Will Google Protocol Buffer ensure this? This is a very important I think.
>


Notes: My message only uses fixed32 and all fields are initialized(values 
might vary)

Message test_msg
{
optional fixed32 field1 = 1;
optional fixed32 field2 = 2;
}

test_msg msg;
msg.set_field1(0);
msg.set_field2(1);

int size = msg.ByteSize(); // will this be a fixed length even if I upgrade 
Google Protocol Buffer? 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Will ByteSize() return a fixed size for fixed object bype if I upgrade Google Protocol Buffer?

2016-09-26 Thread job4charlie
Will Google Protocol Buffer ensure this? This is a very important I think.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated OuterClass has a lot of incompatibilities !

2016-09-26 Thread Smallufo Huang
I am sure I am running version 3.0.0

This is my mvn dependencies :

[INFO] Scanning for projects...
[INFO] 
[INFO] Detecting the operating system and CPU architecture
[INFO] 
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.classifier: osx-x86_64
[INFO] 
[INFO] 
[INFO] Building destiny-identity 0.0.1
[INFO] 
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ destiny-identity 
---
[WARNING] Using Maven 2 dependency tree to get verbose output, which may be 
inconsistent with actual Maven 3 resolution
[INFO] artifact io.netty:netty-codec-http2: checking for updates from nexus
[INFO] artifact io.netty:netty-codec-http2: checking for updates from 
spring-snapshots
[INFO] artifact io.netty:netty-codec-http2: checking for updates from 
spring-milestones
[INFO] artifact io.netty:netty-codec-http2: checking for updates from central
[INFO] artifact io.grpc:grpc-core: checking for updates from nexus
[INFO] artifact io.grpc:grpc-core: checking for updates from spring-snapshots
[INFO] artifact io.grpc:grpc-core: checking for updates from spring-milestones
[INFO] artifact io.grpc:grpc-core: checking for updates from central
[INFO] destiny:destiny-identity:jar:0.0.1
[INFO] +- io.grpc:grpc-netty:jar:1.0.0:compile
[INFO] |  +- io.netty:netty-codec-http2:jar:4.1.3.Final:compile
[INFO] |  |  +- io.netty:netty-codec-http:jar:4.1.3.Final:compile
[INFO] |  |  |  \- io.netty:netty-codec:jar:4.1.3.Final:compile
[INFO] |  |  | \- (io.netty:netty-transport:jar:4.1.3.Final:compile - 
omitted for duplicate)
[INFO] |  |  \- io.netty:netty-handler:jar:4.1.3.Final:compile
[INFO] |  | +- io.netty:netty-buffer:jar:4.1.3.Final:compile
[INFO] |  | |  \- io.netty:netty-common:jar:4.1.3.Final:compile
[INFO] |  | +- io.netty:netty-transport:jar:4.1.3.Final:compile
[INFO] |  | |  +- (io.netty:netty-buffer:jar:4.1.3.Final:compile - omitted 
for duplicate)
[INFO] |  | |  \- io.netty:netty-resolver:jar:4.1.3.Final:compile
[INFO] |  | | \- (io.netty:netty-common:jar:4.1.3.Final:compile - 
omitted for duplicate)
[INFO] |  | \- (io.netty:netty-codec:jar:4.1.3.Final:compile - omitted for 
duplicate)
[INFO] |  \- io.grpc:grpc-core:jar:1.0.0:compile
[INFO] | +- (com.google.guava:guava:jar:19.0:compile - omitted for 
duplicate)
[INFO] | \- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] +- io.grpc:grpc-protobuf:jar:1.0.0:compile
[INFO] |  +- com.google.guava:guava:jar:19.0:compile
[INFO] |  +- io.grpc:grpc-protobuf-lite:jar:1.0.0:compile
[INFO] |  |  +- (com.google.guava:guava:jar:19.0:compile - omitted for 
duplicate)
[INFO] |  |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for duplicate)
[INFO] |  +- com.google.protobuf:protobuf-java:jar:3.0.0:compile
[INFO] |  +- com.google.protobuf:protobuf-java-util:jar:3.0.0:compile
[INFO] |  |  +- (com.google.protobuf:protobuf-java:jar:3.0.0:compile - omitted 
for duplicate)
[INFO] |  |  +- (com.google.guava:guava:jar:18.0:compile - omitted for conflict 
with 19.0)
[INFO] |  |  \- com.google.code.gson:gson:jar:2.7:compile (version managed from 
2.3)
[INFO] |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for duplicate)
[INFO] +- io.grpc:grpc-stub:jar:1.0.0:compile
[INFO] |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for duplicate)
// skipped



It is com.google.protobuf:protobuf-java:jar:3.0.0:compile , and there are 
no other protobuf strings in the following skipped dependencies.

Same problem reported to here : 
https://github.com/grpc/grpc-java/issues/2300

Sorry , not sure where goes wrong , so I post to many places.



Feng Xiao於 2016年9月27日星期二 UTC+8上午2時02分37秒寫道:
>
>
>
> On Mon, Sep 26, 2016 at 8:53 AM, Smallufo Huang  > wrote:
>
>> Hi , I am new to gRPC / protobuf.
>>
>> This is my first .proto file :
>>
>> syntax = "proto3";
>> option java_package = "destiny.identity.services.grpc";
>>
>> service EchoService {
>> rpc echo (EchoRequest) returns (EchoReply) {}
>> }
>>
>> message EchoRequest {
>> string name=1;
>> }
>>
>> message EchoReply {
>> string message = 1;
>> }
>>
>>
>> It is simple , but the generated EchoServiceOuterClass.java has a lot of 
>> incompatibilities :
>>
>>
>> ~/destiny-identity/target/generated-sources/protobuf/java/destiny/identity/services/grpc/EchoServiceOuterClass.java
>> Error:(83, 13) java: incompatible types: java.io.IOException cannot be 
>> converted to java.lang.String
>> Error:(152, 18) java: memoizedSize has private access in 
>> com.google.protobuf.AbstractMessage
>> Error:(159, 7) java: memoizedSize has private access in 
>> com.google.protobuf.AbstractMessage
>> Error:(394, 18) java: cannot

Re: [protobuf] Generated OuterClass has a lot of incompatibilities !

2016-09-26 Thread Smallufo Huang
I am sure I am running version 3.0.0

This is my mvn dependencies :

[INFO] Scanning for projects...

[INFO] 


[INFO] Detecting the operating system and CPU architecture

[INFO] 


[INFO] os.detected.name: osx

[INFO] os.detected.arch: x86_64

[INFO] os.detected.classifier: osx-x86_64

[INFO]  
   

[INFO] 


[INFO] Building destiny-identity 0.0.1

[INFO] 


[INFO] 

[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ 
destiny-identity ---

[WARNING] Using Maven 2 dependency tree to get verbose output, which may be 
inconsistent with actual Maven 3 resolution

[INFO] artifact io.netty:netty-codec-http2: checking for updates from nexus

[INFO] artifact io.netty:netty-codec-http2: checking for updates from 
spring-snapshots

[INFO] artifact io.netty:netty-codec-http2: checking for updates from 
spring-milestones

[INFO] artifact io.netty:netty-codec-http2: checking for updates from 
central

[INFO] artifact io.grpc:grpc-core: checking for updates from nexus

[INFO] artifact io.grpc:grpc-core: checking for updates from 
spring-snapshots

[INFO] artifact io.grpc:grpc-core: checking for updates from 
spring-milestones

[INFO] artifact io.grpc:grpc-core: checking for updates from central

[INFO] destiny:destiny-identity:jar:0.0.1

[INFO] +- io.grpc:grpc-netty:jar:1.0.0:compile

[INFO] |  +- io.netty:netty-codec-http2:jar:4.1.3.Final:compile

[INFO] |  |  +- io.netty:netty-codec-http:jar:4.1.3.Final:compile

[INFO] |  |  |  \- io.netty:netty-codec:jar:4.1.3.Final:compile

[INFO] |  |  | \- (io.netty:netty-transport:jar:4.1.3.Final:compile - 
omitted for duplicate)

[INFO] |  |  \- io.netty:netty-handler:jar:4.1.3.Final:compile

[INFO] |  | +- io.netty:netty-buffer:jar:4.1.3.Final:compile

[INFO] |  | |  \- io.netty:netty-common:jar:4.1.3.Final:compile

[INFO] |  | +- io.netty:netty-transport:jar:4.1.3.Final:compile

[INFO] |  | |  +- (io.netty:netty-buffer:jar:4.1.3.Final:compile - 
omitted for duplicate)

[INFO] |  | |  \- io.netty:netty-resolver:jar:4.1.3.Final:compile

[INFO] |  | | \- (io.netty:netty-common:jar:4.1.3.Final:compile - 
omitted for duplicate)

[INFO] |  | \- (io.netty:netty-codec:jar:4.1.3.Final:compile - omitted 
for duplicate)

[INFO] |  \- io.grpc:grpc-core:jar:1.0.0:compile

[INFO] | +- (com.google.guava:guava:jar:19.0:compile - omitted for 
duplicate)

[INFO] | \- com.google.code.findbugs:jsr305:jar:3.0.0:compile

[INFO] +- io.grpc:grpc-protobuf:jar:1.0.0:compile

[INFO] |  +- com.google.guava:guava:jar:19.0:compile

[INFO] |  +- io.grpc:grpc-protobuf-lite:jar:1.0.0:compile

[INFO] |  |  +- (com.google.guava:guava:jar:19.0:compile - omitted for 
duplicate)

[INFO] |  |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for 
duplicate)

[INFO] |  +- com.google.protobuf:protobuf-java:jar:3.0.0:compile

[INFO] |  +- com.google.protobuf:protobuf-java-util:jar:3.0.0:compile

[INFO] |  |  +- (com.google.protobuf:protobuf-java:jar:3.0.0:compile - 
omitted for duplicate)

[INFO] |  |  +- (com.google.guava:guava:jar:18.0:compile - omitted for 
conflict with 19.0)

[INFO] |  |  \- com.google.code.gson:gson:jar:2.7:compile (version managed 
from 2.3)

[INFO] |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for duplicate)

[INFO] +- io.grpc:grpc-stub:jar:1.0.0:compile

[INFO] |  \- (io.grpc:grpc-core:jar:1.0.0:compile - omitted for duplicate)


It is com.google.protobuf:protobuf-java:jar:3.0.0:compile , and there are 
no other protobufstrings in the following skipped dependencies.



Same problem reported to github here : 
https://github.com/grpc/grpc-java/issues/2300
(sorry , not sure where goes wrong , so I post to multiple places)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Generated OuterClass has a lot of incompatibilities !

2016-09-26 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Sep 26, 2016 at 8:53 AM, Smallufo Huang  wrote:

> Hi , I am new to gRPC / protobuf.
>
> This is my first .proto file :
>
> syntax = "proto3";
> option java_package = "destiny.identity.services.grpc";
>
> service EchoService {
> rpc echo (EchoRequest) returns (EchoReply) {}
> }
>
> message EchoRequest {
> string name=1;
> }
>
> message EchoReply {
> string message = 1;
> }
>
>
> It is simple , but the generated EchoServiceOuterClass.java has a lot of
> incompatibilities :
>
> ~/destiny-identity/target/generated-sources/protobuf/java/
> destiny/identity/services/grpc/EchoServiceOuterClass.java
> Error:(83, 13) java: incompatible types: java.io.IOException cannot be
> converted to java.lang.String
> Error:(152, 18) java: memoizedSize has private access in
> com.google.protobuf.AbstractMessage
> Error:(159, 7) java: memoizedSize has private access in
> com.google.protobuf.AbstractMessage
> Error:(394, 18) java: cannot find symbol
>   symbol:   method unwrapIOException()
>   location: variable e of type com.google.protobuf.InvalidPro
> tocolBufferException
> Error:(586, 13) java: incompatible types: java.io.IOException cannot be
> converted to java.lang.String
> Error:(655, 18) java: memoizedSize has private access in
> com.google.protobuf.AbstractMessage
> Error:(662, 7) java: memoizedSize has private access in
> com.google.protobuf.AbstractMessage
> Error:(897, 18) java: cannot find symbol
>   symbol:   method unwrapIOException()
>   location: variable e of type com.google.protobuf.InvalidPro
> tocolBufferException
>
This indicates a version mismatch between protocol compiler and protobuf
runtime. Are you depending the right protobuf-java 3.0.0 version?


>
> This is my [ partial ] pom.xml
>
> 
>   org.xolstice.maven.plugins
>   protobuf-maven-plugin
>   0.5.0
>   
> 
> 
> com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}
> grpc-java
> 
> io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}
>   
>   
> 
>   
> compile
> compile-custom
>   
> 
>   
> 
>
>
> The* grpc-netty , grpc-protobuf , grpc-stub* are all of version of 1.0.0
>
> Where goes wrong here ?
> Thanks.
>
> (I don't know whether the problem is related to protobuf or gRPC , so I
> paste to both forum )
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] How to describe in the proto file a json format with a double array?

2016-09-26 Thread Michael Leonard
Hi

I'm developing a golang server that will receive json in the following 
format. I can't work out how to write the description of this in a proto 
file and am hoping someone could help me! Thanks a lot in advance. 

{
"key1": "asdfwefa",
"key2": 13431,
"key3": [
  [
"asdfasdf",
"cdcasdec",
"dareceae"
  ],
  [
"ggeqsase",
"asdfdfgg",
"asdreavf"
  ]
]
 }

The problem is the double array and the fact that the strings inside the 
array don't have named keys. I want to use something like following, but 
I'm not sure if there's a way to do this:

message MyObject {
string key1 = 1;
int32 key2 = 2;
repeated Key3 key3 = 3;
}

message Key3 {
repeated ...???...
}


Please note:
- I'm using proto3 syntax in my application in case that's important 
information.
- I can't modify the json format before it hits my golang server. However I 
could modify it when it arrives (somehow? perhaps marshal to a golang 
struct first, or modify the text string somehow - any easy solutions would 
be appreciated?) and then marshal it using the golang jsonpb package.


Thanks for any help

Mike


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Generated OuterClass has a lot of incompatibilities !

2016-09-26 Thread Smallufo Huang
Hi , I am new to gRPC / protobuf.

This is my first .proto file :

syntax = "proto3";
option java_package = "destiny.identity.services.grpc";

service EchoService {
rpc echo (EchoRequest) returns (EchoReply) {}
}

message EchoRequest {
string name=1;
}

message EchoReply {
string message = 1;
}


It is simple , but the generated EchoServiceOuterClass.java has a lot of 
incompatibilities :

~/destiny-identity/target/generated-sources/protobuf/java/destiny/identity/services/grpc/EchoServiceOuterClass.java
Error:(83, 13) java: incompatible types: java.io.IOException cannot be 
converted to java.lang.String
Error:(152, 18) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(159, 7) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(394, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type 
com.google.protobuf.InvalidProtocolBufferException
Error:(586, 13) java: incompatible types: java.io.IOException cannot be 
converted to java.lang.String
Error:(655, 18) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(662, 7) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(897, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type 
com.google.protobuf.InvalidProtocolBufferException

This is my [ partial ] pom.xml


  org.xolstice.maven.plugins
  protobuf-maven-plugin
  0.5.0
  


com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}
grpc-java

io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}
  
  

  
compile
compile-custom
  

  



The* grpc-netty , grpc-protobuf , grpc-stub* are all of version of 1.0.0

Where goes wrong here ?
Thanks.

(I don't know whether the problem is related to protobuf or gRPC , so I 
paste to both forum )


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Generated xxxOuterClass has a lot of incompatibilities .

2016-09-26 Thread Smallufo Huang
I am new to gRPC , this is my simple .proto file 

syntax = "proto3";
option java_package = "destiny.identity.services.grpc";

service EchoService {
rpc echo (EchoRequest) returns (EchoReply) {}
}

message EchoRequest {
string name=1;
}

message EchoReply {
string message = 1;
}


when compiles , the generated EchoServiceOuterClass.java has a lot of 
incompatibilities :

Error:(83, 13) java: incompatible types: java.io.IOException cannot be 
converted to java.lang.String
Error:(152, 18) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(159, 7) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(394, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type 
com.google.protobuf.InvalidProtocolBufferException
Error:(586, 13) java: incompatible types: java.io.IOException cannot be 
converted to java.lang.String
Error:(655, 18) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(662, 7) java: memoizedSize has private access in 
com.google.protobuf.AbstractMessage
Error:(897, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type 
com.google.protobuf.InvalidProtocolBufferException

What may be wrong ?

This is my pom.xml


  org.xolstice.maven.plugins
  protobuf-maven-plugin
  0.5.0
  


com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}
grpc-java

io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}
  
  

  
compile
compile-custom
  

  



And the io.grpc's grpc-netty , grpc-protobuf , grpc-stub are all version of 
1.0.0


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Protobuf documentation

2016-09-26 Thread Arpit Baldeva
Okay, thanks. I did not realize the syntax bit earlier. 

I wasn't exactly compiling that sample actually. I was compiling the 
AddressBook sample that came with the pre-built bin of ProtoC (and was 
modifying it based on the sample). That file did have the syntax explicitly 
set to proto3. 

--Arpit

On Saturday, September 24, 2016 at 7:44:29 AM UTC-7, Adam Cozzette wrote:
>
> When you create a .proto file you can set either syntax = "proto2"; or syntax 
> = "proto3"; at the top, and the protobuf compiler and runtime support 
> both (as long as you're using version 3.0 or higher). We are planning to 
> support both syntaxes indefinitely, both for backward compatibility and 
> because proto2 is still a good choice for new projects that require 
> features such as unknown fields that do not exist in proto3.
>
> What was the error message you saw? I tried compiling the example just now 
> and it worked just fine, although protoc did log a warning that I needed to 
> set the syntax.
>
> On Fri, Sep 23, 2016 at 8:43 PM, Arpit Baldeva  > wrote:
>
>> As a little background, I am a new user to protobuf. Naturally, I am 
>> trying latest releases. And I see no mention on the page that this syntax 
>> may not be supported in latest version. So it ends up being odd that the 
>> first example I see does not compile with latest release :).
>>
>> --
>> 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.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.