Re: [protobuf] How to generate google.protobuf.Type object from a file

2017-10-20 Thread Josh Humphries
On Fri, Oct 20, 2017 at 9:05 PM, 'Adam Cozzette' via Protocol Buffers <
protobuf@googlegroups.com> wrote:

> I've CC'd Jisi who can confirm this, but I believe we actually went in a
> different direction and did not implement the type server idea. In practice
> we use the type_url field as an identifier but there is no actual server
> returning Type objects.
>

I've heard this a couple of times before, that the type server stuff was
abandoned. Could the docs be updated to reflect this? They still indicate
that type definitions will be downloadable from servers via the type URL.


>
> On Thu, Oct 19, 2017 at 11:52 AM,  wrote:
>
>> Hi All,
>>
>> The documentation for google.protobuf.Any says that an HTTP GET on the
>> URL should return a Type object in binary. However, I can't find any
>> documentation on how create a Type object from a protobuf definition file.
>> Given a compiled Message, how can I get a Type?
>>
>> Thanks,
>> Pradeep
>>
>> --
>> 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.
>

-- 
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] How to generate google.protobuf.Type object from a file

2017-10-20 Thread Josh Humphries
FWIW, I've implemented this logic in Go in a library called protoreflect,
with the intention that it could be used for the type server functionality,
as documented.

Take a look at the methods MessageAsPType and EnumAsPType in MessageRegistry:
https://godoc.org/github.com/jhump/protoreflect/dynamic/msgregistry


*Josh Humphries*
jh...@bluegosling.com

On Thu, Oct 19, 2017 at 2:52 PM,  wrote:

> Hi All,
>
> The documentation for google.protobuf.Any says that an HTTP GET on the URL
> should return a Type object in binary. However, I can't find any
> documentation on how create a Type object from a protobuf definition file.
> Given a compiled Message, how can I get a Type?
>
> Thanks,
> Pradeep
>
> --
> 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] Can I represent the following JSON code in a protobuf?

2017-10-20 Thread 'Adam Cozzette' via Protocol Buffers
Something like this should work (I just guessed at the type of the 1, 2,
and 3 fields since it's not clear from the example):

message InnerMessage {
  repeated int32 i1 = 1 [json_name = "1"];
  repeated int32 i2 = 2 [json_name = "2"];
  repeated int32 i3 = 3 [json_name = "3"];
}

message OuterMessage {
  repeated InnerMessage some_message = 1;
}

On Fri, Oct 20, 2017 at 12:08 PM, Daniel Roberts <
daniel.j.robert...@gmail.com> wrote:

> {
>  "someMessage": [
> {
>   "1": []
>  },
>  {
>  "2": []
>  },
>  {
>  "3": []
>  }
>  ]
> }
>
>
> My attempt at a protobuf format
>
> message someMessage
> {
>
> }
>
> --
> 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] Can I represent the following JSON code in a protobuf?

2017-10-20 Thread Daniel Roberts
{
 "someMessage": [
{
  "1": []
 },
 {
 "2": []
 },
 {
 "3": []
 }
 ]
}


My attempt at a protobuf format

message someMessage
{

}

-- 
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] Equivalent of protoc --decode_raw via jvm library

2017-10-20 Thread Jeff White
Is there anything that can generate the equivalent of 'protoc --decode_raw' 
in any of the jvm libraries?

Is it not a common use case to dump human-readable representation of the 
binary format in cases it cannot be parsed at runtime, for troubleshooting 
purposes?


-- 
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] Error in the Java Classes for Protocol Buffer 3.4.1

2017-10-20 Thread Nasim Hasan
Hello Adam,
 Thanks for replying to my mail. I think that, I have
found out the solution. Your Protocol Buffer's Version and Protocol
Buffer's Compiler (protoc) Version needs to be same. So, I have
followed that criteria and found out that everything is working fine
now...!!

Best Regards,
Nasim Hasan

On 10/20/17, Adam Cozzette  wrote:
> Could you send us the error messages you're seeing?
>
> On Tue, Oct 17, 2017 at 3:07 AM, Nasim Hasan  wrote:
>
>> Hello All,
>> I am Nasim Hasan and I am new to the Protocol Buffer. I will
>> have to use the Protocol Buffer for communicating with a 3D Simulator
>> (Gazebo). I am using the Protocol Buffer 3.4.1 for Java. But, when I use
>> (by importing) the predefined classes for Java in my project, I am
>> getting
>> error from the following classes:
>>
>> 1. Descriptors.java.
>> 2. DynamicMessage.java.
>> 3. ExtensionRegistry.java.
>> 4. MessageReflection.java.
>> 5. TextFormat.java.
>>
>> So, can anyone from this group help me regarding this matter
>> urgently... The help would be much appreciated..
>>
>> Thanks-
>> Nasim Hasan
>>
>> --
>> 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] Error in the Java Classes for Protocol Buffer 3.4.1

2017-10-20 Thread 'Adam Cozzette' via Protocol Buffers
Could you send us the error messages you're seeing?

On Tue, Oct 17, 2017 at 3:07 AM, Nasim Hasan  wrote:

> Hello All,
> I am Nasim Hasan and I am new to the Protocol Buffer. I will
> have to use the Protocol Buffer for communicating with a 3D Simulator
> (Gazebo). I am using the Protocol Buffer 3.4.1 for Java. But, when I use
> (by importing) the predefined classes for Java in my project, I am getting
> error from the following classes:
>
> 1. Descriptors.java.
> 2. DynamicMessage.java.
> 3. ExtensionRegistry.java.
> 4. MessageReflection.java.
> 5. TextFormat.java.
>
> So, can anyone from this group help me regarding this matter
> urgently... The help would be much appreciated..
>
> Thanks-
> Nasim Hasan
>
> --
> 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] Protobuf Compile problems on the aix environment

2017-10-20 Thread 'Adam Cozzette' via Protocol Buffers
We don't test on AIX because we don't have access to an AIX environment,
but I'm guessing that with a bit of effort you could get the code to
compile. If you can get it working, feel free to send us a pull request
with the necessary fixes.

On Mon, Oct 16, 2017 at 2:03 AM,  wrote:

> Protobuf-3.2 has been verified in aix environment?  I compile it on aix
> recently. but there are a lot of compile error, may be my compiler version
> is too low.
> xlc version :
> IBM XL C/C++ for AIX, V11.1 (5724-X13)
> Version: 11.01..0005
> OS version: 6100-04-06-1034
>
> for example:
>
>  xlC_r -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -DHAVE_PTHREAD=1
> -qkeepinlines -qrtti=all -qtls -c -M 
> google/protobuf/generated_message_reflection.cc
>  -DPIC -o google/protobuf/.libs/generated_message_reflection.o
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> 1540-0216 (S) An expression of type "void (google::protobuf::Message::*)(const
> Message &)" cannot be converted to type "bool 
> (google::protobuf::Message::*)(const
> Message &)".
> "./google/protobuf/repeated_field.h", line 595.23: 1540-0723 (S) The
> inline function "void *GetMaybeArenaPointer(Message *)" is referenced, but
> it is not defined.
> make: The error code from the last command is 1.
>
>
> 
>
> --
> 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.