Thank you Feng, that solved my issue as well.

On Thursday, January 12, 2017 at 10:54:20 AM UTC-8, Feng Xiao wrote:
>
> To print Any in JSON, you need to provide a TypeRegistry including the 
> descriptor of all types that may be included in the Any field. See an 
> example here:
>
> https://github.com/google/protobuf/blob/master/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java#L811
>
> On Thu, Jan 12, 2017 at 9:01 AM, Michael Lindenmayer <[email protected] 
> <javascript:>> wrote:
>
>> I am having some trouble creating a message and printing it to JSON using 
>> the any type. Below is the code that is run:
>>
>>
>>       Any any = Any.pack(myMessage);
>>       
>>       String jsonFormat = JsonFormat.printer().print(any);
>>
>> This thrown an exception: Cannot find type for url: 
>> type.googleapis.com/org.apache.activemq.recipies.messages.MyMessage
>>
>> I feel like the mistake is simple, but I can't seem to figure it out.
>>
>> Any help would be appreciated!!!
>>
>> Michael
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/18b80768-8765-4ca6-8916-67672a0de745%40googlegroups.com.

Reply via email to