You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by 獻輝黃 <kl...@gmail.com> on 2009/09/25 10:11:27 UTC

Sample Prototcol

hi everyone,
I try to compile the Sample Protocol which on the Specification ,

when I use 「java
org.apache.avro.specific.SpecificCompiler<http://wiki.apache.org/hadoop/SpecificCompiler>」
to compile it,

it show the error message like *「Exception in thread "main"
org.apache.avro.SchemaParseException:
org.codehaus.ja**ckson.JsonParseException:
Unexpected character ('{' (code 123)): was expecting comma to separate ARRAY
entries』*
*
*
I only copy and paste the same code,

can anyone give me some suggestions?

klein
===================================
中華電信研究所 助理研究員
黃獻輝
mail:klein128@gmail.com
msn:klein1022@msn.com
website:http://my.klein.tw/

Re: Sample Prototcol

Posted by 獻輝黃 <kl...@gmail.com>.
thanks a lot!

I will try it,



2009/9/26 Doug Cutting <cu...@apache.org>

> 獻輝黃 wrote:
>
>> I try to compile the Sample Protocol which on the Specification ,
>>
>> when I use 「java org.apache.avro.specific.SpecificCompiler <
>> http://wiki.apache.org/hadoop/SpecificCompiler>」 to compile it,
>>
>> it show the error message like *「Exception in thread "main"
>> org.apache.avro.SchemaParseException: org.codehaus.ja*
>> *ckson.JsonParseException: Unexpected character ('{' (code 123)): was
>> expecting comma to separate ARRAY entries』*
>>
>
> This is an error in the specification document.
>
> I have filed an issue in Jira for this:
>
>  https://issues.apache.org/jira/browse/AVRO-125
>
> The correct sample protocol is:
>
> {
>  "namespace": "com.acme",
>  "protocol": "HelloWorld",
>
>  "types": [
>    {"name": "Greeting", "type": "record", "fields": [
>      {"name": "message", "type": "string"}]},
>    {"name": "Curse", "type": "error", "fields": [
>      {"name": "message", "type": "string"}]}
>  ],
>
>  "messages": {
>    "hello": {
>      "request": [{"name": "greeting", "type": "Greeting" }],
>      "response": "Greeting",
>      "errors": ["Curse"]
>    }
>  }
> }
>
> Thank you for reporting this.  It will be fixed in the documentation of the
> next Avro release, 1.2.
>
> Doug
>

Re: Sample Prototcol

Posted by Doug Cutting <cu...@apache.org>.
獻輝黃 wrote:
> I try to compile the Sample Protocol which on the Specification ,
> 
> when I use 「java org.apache.avro.specific.SpecificCompiler 
> <http://wiki.apache.org/hadoop/SpecificCompiler>」 to compile it,
> 
> it show the error message like *「Exception in thread "main" 
> org.apache.avro.SchemaParseException: org.codehaus.ja*
> *ckson.JsonParseException: Unexpected character ('{' (code 123)): was 
> expecting comma to separate ARRAY entries』*

This is an error in the specification document.

I have filed an issue in Jira for this:

   https://issues.apache.org/jira/browse/AVRO-125

The correct sample protocol is:

{
   "namespace": "com.acme",
   "protocol": "HelloWorld",

   "types": [
     {"name": "Greeting", "type": "record", "fields": [
       {"name": "message", "type": "string"}]},
     {"name": "Curse", "type": "error", "fields": [
       {"name": "message", "type": "string"}]}
   ],

   "messages": {
     "hello": {
       "request": [{"name": "greeting", "type": "Greeting" }],
       "response": "Greeting",
       "errors": ["Curse"]
     }
   }
}

Thank you for reporting this.  It will be fixed in the documentation of 
the next Avro release, 1.2.

Doug