You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Alex Newman <po...@gmail.com> on 2009/08/03 20:03:34 UTC

issues getting with the SpecificCompiler

I am currently having some issues getting the SpecificCompiler
infrastructure working.

Here is my json
{
   "namespace": "org.apache.hadoop.hbase.avro",
   "protocol": "HBase",

   "types": [
       {"name": "Mutation", "type": "record",
           "fields": [
           {"name": "isDelete", "type": "boolean", "default" :false},
           {"name": "column", "type": "bytes"},
           {"name": "value", "type": "bytes"}
           ]
       },
       {"name": "BatchMutation", "type": "record",
           "fields": [
               {"name": "row", "type": "bytes"},
               {"name": "mutations", "type": {
                   "type":"array",
                   "items": "Mutation"
                   }
               }
           ]
       }
   ],
   "messages": {
       "isTableEnabled": {
           "request": [
               {
                   "name": "tableName",
                   "type": "bytes"
               }
           ],
           "response": "boolean"
       },
       "mutateRows": {
           "request": [
               {
                   "name": "tableName",
                   "type": "bytes"
               },
               {
                   "name": "batchMutation",
                   "type":
                       {
                           "type":"array",
                           "items": "BatchMutation"
                       }
               }
           ],
           "response": "null"
       }
   }
}

I get
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
       at org.apache.avro.reflect.ReflectData.getMessage(ReflectData.java:236)
       at org.apache.avro.reflect.ReflectData.getProtocol(ReflectData.java:212)
       at org.apache.avro.reflect.ReflectResponder.<init>(ReflectResponder.java:45)
       at org.apache.avro.specific.SpecificResponder.<init>(SpecificResponder.java:29)
       at org.apache.hadoop.hbase.avro.AvroServer.main(AvroServer.java:214)


at line
    server = new SocketServer(new SpecificResponder(HBase.class,
                   new HBaseImpl()) ,
                   new InetSocketAddress(port));


btw
   private static class HBaseImpl implements HBase{

Re: Re: issues getting with the SpecificCompiler

Posted by po...@gmail.com.
Eelco, no it was some sun 6 jdk. I should be able to make a more detailed  
report today.

On Aug 19, 2009 12:50am, Eelco Hillenius <ee...@gmail.com> wrote:
> >> I get

> >> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

> >> at

> >> org.apache.avro.reflect.ReflectData.getMessage(ReflectData.java:236)



> Alex, did you by any chance compile this using the Eclipse compiler?

> It seems to be the same issue as

> http://issues.apache.org/jira/browse/AVRO-94



> Eelco


Re: issues getting with the SpecificCompiler

Posted by Eelco Hillenius <ee...@gmail.com>.
>> I get
>> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
>>       at
>> org.apache.avro.reflect.ReflectData.getMessage(ReflectData.java:236)

Alex, did you by any chance compile this using the Eclipse compiler?
It seems to be the same issue as
http://issues.apache.org/jira/browse/AVRO-94

Eelco

Re: issues getting with the SpecificCompiler

Posted by Doug Cutting <cu...@apache.org>.
Can you please provide a complete, self-contained test case for this, so 
that I can easily reproduce it?  Thanks!

Doug

Alex Newman wrote:
> I am currently having some issues getting the SpecificCompiler
> infrastructure working.
> 
> Here is my json
> {
>    "namespace": "org.apache.hadoop.hbase.avro",
>    "protocol": "HBase",
> 
>    "types": [
>        {"name": "Mutation", "type": "record",
>            "fields": [
>            {"name": "isDelete", "type": "boolean", "default" :false},
>            {"name": "column", "type": "bytes"},
>            {"name": "value", "type": "bytes"}
>            ]
>        },
>        {"name": "BatchMutation", "type": "record",
>            "fields": [
>                {"name": "row", "type": "bytes"},
>                {"name": "mutations", "type": {
>                    "type":"array",
>                    "items": "Mutation"
>                    }
>                }
>            ]
>        }
>    ],
>    "messages": {
>        "isTableEnabled": {
>            "request": [
>                {
>                    "name": "tableName",
>                    "type": "bytes"
>                }
>            ],
>            "response": "boolean"
>        },
>        "mutateRows": {
>            "request": [
>                {
>                    "name": "tableName",
>                    "type": "bytes"
>                },
>                {
>                    "name": "batchMutation",
>                    "type":
>                        {
>                            "type":"array",
>                            "items": "BatchMutation"
>                        }
>                }
>            ],
>            "response": "null"
>        }
>    }
> }
> 
> I get
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
>        at org.apache.avro.reflect.ReflectData.getMessage(ReflectData.java:236)
>        at org.apache.avro.reflect.ReflectData.getProtocol(ReflectData.java:212)
>        at org.apache.avro.reflect.ReflectResponder.<init>(ReflectResponder.java:45)
>        at org.apache.avro.specific.SpecificResponder.<init>(SpecificResponder.java:29)
>        at org.apache.hadoop.hbase.avro.AvroServer.main(AvroServer.java:214)
> 
> 
> at line
>     server = new SocketServer(new SpecificResponder(HBase.class,
>                    new HBaseImpl()) ,
>                    new InetSocketAddress(port));
> 
> 
> btw
>    private static class HBaseImpl implements HBase{