avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Sample Prototcol
Date Fri, 25 Sep 2009 19:27:00 GMT
獻輝黃 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

Mime
View raw message