You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Lewis John Mcgibbney <le...@gmail.com> on 2015/01/06 22:50:24 UTC

Exception No protocol name specified for Record

Hi Folks,
I have the following small schema

{
  "name": "Host",
  "type": "record",
  "namespace": "org.apache.nutch.storage",
  "doc": "Host represents a store of webpages or other data which
resides on a server or other computer so that it can be accessed over
the Internet",
  "fields": [
    {
      "name": "metadata",
      "type": {
        "type": "map",
        "values": ["null","bytes"]
      },
      "doc": "A multivalued metadata container used for storing a wide
variety of host metadata such as structured web server characterists
etc",
      "default": {

      }
    },
    {
      "name": "outlinks",
      "type": {
        "type": "map",
        "values": ["null","string"]
      },
      "doc": "Hyperlinks which direct outside of the current host
domain these can used in a histogram style manner to generate host
statistics",
      "default": {

      }
    },
    {
      "name": "inlinks",
      "type": {
        "type": "map",
        "values": ["null","string"]
      },
      "doc": "Hyperlinks which link to pages within the current host
domain these can used in a histogram style manner to generate host
statistics",
      "default": {

      }
    }
  ]
}


When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
following parse exception

     [java] Caused by: org.apache.avro.SchemaParseException: No protocol
name specified:
{"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
represents a store of webpages or other data which resides on a server or
other computer so that it can be accessed over the
Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
multivalued metadata container used for storing a wide variety of host
metadata such as structured web server characterists
etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
which direct outside of the current host domain these can used in a
histogram style manner to generate host
statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
which link to pages within the current host domain these can used in a
histogram style manner to generate host statistics","default":{}}]}
     [java]     at org.apache.avro.Protocol.parseName(Protocol.java:426)
     [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
     [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
     [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
     [java]     at
org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
     [java]     at
org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
     [java]     at
org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java]     at java.lang.reflect.Method.invoke(Method.java:606)
     [java]     at
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     ... 20 more
     [java] Java Result: -1

The thing is that I do not wish this to be a Protocol as such, it is merely
a simple Schema. Can anyone help me out to debug this?
Thank you
Lewis

-- 
*Lewis*

Re: Exception No protocol name specified for Record

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Thank you Doug. This is bang on.

On Wed, Jan 7, 2015 at 11:12 AM, Doug Cutting <cu...@apache.org> wrote:

> You're calling GoraCompiler#main, which inherits
> SpecificCompiler#main, which unconditionally calls compileSchema.
>
> You could wrap your record schema in {"protocol":"X", ..., "types": [
> <schema> ] } so this works.
>
> Or you might use SpecificCompilerTool, which supports compiling both
> schemas and protocols from the command line.  This is in the
> avro-tools jar with dependencies included or in avro-tools-nodeps
> without.
>
> Doug
>
>
>
> On Wed, Jan 7, 2015 at 10:49 AM, Lewis John Mcgibbney
> <le...@gmail.com> wrote:
> > Hey Joey or anyone else.
> > Any ideas what is up here? I read through the Avro spec to see if I was
> > missing something (which I most likely am) but couldn't find a sausage.
> > Thanks again in advance for any help.
> > The schema is valid JSON, the stack trace is looking for a Protocol when
> it
> > is clearly marked as a Record.
> >
> > On Tue, Jan 6, 2015 at 2:42 PM, Joey Echeverria <jo...@cloudera.com>
> wrote:
> >>
> >> Can you send the definition of the ant task that you're using to parse
> it?
> >>
> >> -Joey
> >>
> >> On Tue, Jan 6, 2015 at 1:50 PM, Lewis John Mcgibbney
> >> <le...@gmail.com> wrote:
> >> > Hi Folks,
> >> > I have the following small schema
> >> >
> >> > {
> >> >   "name": "Host",
> >> >   "type": "record",
> >> >   "namespace": "org.apache.nutch.storage",
> >> >   "doc": "Host represents a store of webpages or other data which
> >> > resides on
> >> > a server or other computer so that it can be accessed over the
> >> > Internet",
> >> >   "fields": [
> >> >     {
> >> >       "name": "metadata",
> >> >       "type": {
> >> >         "type": "map",
> >> >         "values": ["null","bytes"]
> >> >       },
> >> >       "doc": "A multivalued metadata container used for storing a wide
> >> > variety of host metadata such as structured web server characterists
> >> > etc",
> >> >       "default": {
> >> >
> >> >       }
> >> >     },
> >> >     {
> >> >       "name": "outlinks",
> >> >       "type": {
> >> >         "type": "map",
> >> >         "values": ["null","string"]
> >> >       },
> >> >       "doc": "Hyperlinks which direct outside of the current host
> domain
> >> > these can used in a histogram style manner to generate host
> statistics",
> >> >       "default": {
> >> >
> >> >       }
> >> >     },
> >> >     {
> >> >       "name": "inlinks",
> >> >       "type": {
> >> >         "type": "map",
> >> >         "values": ["null","string"]
> >> >       },
> >> >       "doc": "Hyperlinks which link to pages within the current host
> >> > domain
> >> > these can used in a histogram style manner to generate host
> statistics",
> >> >       "default": {
> >> >
> >> >       }
> >> >     }
> >> >   ]
> >> > }
> >> >
> >> >
> >> > When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
> >> > following parse exception
> >> >
> >> >      [java] Caused by: org.apache.avro.SchemaParseException: No
> protocol
> >> > name specified:
> >> >
> >> >
> {"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
> >> > represents a store of webpages or other data which resides on a server
> >> > or
> >> > other computer so that it can be accessed over the
> >> >
> >> >
> Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
> >> > multivalued metadata container used for storing a wide variety of host
> >> > metadata such as structured web server characterists
> >> >
> >> >
> etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> >> > which direct outside of the current host domain these can used in a
> >> > histogram style manner to generate host
> >> >
> >> >
> statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> >> > which link to pages within the current host domain these can used in a
> >> > histogram style manner to generate host statistics","default":{}}]}
> >> >      [java]     at
> org.apache.avro.Protocol.parseName(Protocol.java:426)
> >> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
> >> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
> >> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
> >> >      [java]     at
> >> >
> >> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
> >> >      [java]     at
> >> >
> >> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
> >> >      [java]     at
> >> >
> >> >
> org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
> >> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >> >      [java]     at
> >> >
> >> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >> >      [java]     at
> >> >
> >> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >> >      [java]     at java.lang.reflect.Method.invoke(Method.java:606)
> >> >      [java]     at
> >> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> >> >      [java]     at
> >> >
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> >> >      [java]     ... 20 more
> >> >      [java] Java Result: -1
> >> >
> >> > The thing is that I do not wish this to be a Protocol as such, it is
> >> > merely
> >> > a simple Schema. Can anyone help me out to debug this?
> >> > Thank you
> >> > Lewis
> >> >
> >> > --
> >> > Lewis
> >>
> >>
> >>
> >> --
> >> Joey Echeverria
> >
> >
> >
> >
> > --
> > Lewis
>



-- 
*Lewis*

Re: Exception No protocol name specified for Record

Posted by Doug Cutting <cu...@apache.org>.
You're calling GoraCompiler#main, which inherits
SpecificCompiler#main, which unconditionally calls compileSchema.

You could wrap your record schema in {"protocol":"X", ..., "types": [
<schema> ] } so this works.

Or you might use SpecificCompilerTool, which supports compiling both
schemas and protocols from the command line.  This is in the
avro-tools jar with dependencies included or in avro-tools-nodeps
without.

Doug



On Wed, Jan 7, 2015 at 10:49 AM, Lewis John Mcgibbney
<le...@gmail.com> wrote:
> Hey Joey or anyone else.
> Any ideas what is up here? I read through the Avro spec to see if I was
> missing something (which I most likely am) but couldn't find a sausage.
> Thanks again in advance for any help.
> The schema is valid JSON, the stack trace is looking for a Protocol when it
> is clearly marked as a Record.
>
> On Tue, Jan 6, 2015 at 2:42 PM, Joey Echeverria <jo...@cloudera.com> wrote:
>>
>> Can you send the definition of the ant task that you're using to parse it?
>>
>> -Joey
>>
>> On Tue, Jan 6, 2015 at 1:50 PM, Lewis John Mcgibbney
>> <le...@gmail.com> wrote:
>> > Hi Folks,
>> > I have the following small schema
>> >
>> > {
>> >   "name": "Host",
>> >   "type": "record",
>> >   "namespace": "org.apache.nutch.storage",
>> >   "doc": "Host represents a store of webpages or other data which
>> > resides on
>> > a server or other computer so that it can be accessed over the
>> > Internet",
>> >   "fields": [
>> >     {
>> >       "name": "metadata",
>> >       "type": {
>> >         "type": "map",
>> >         "values": ["null","bytes"]
>> >       },
>> >       "doc": "A multivalued metadata container used for storing a wide
>> > variety of host metadata such as structured web server characterists
>> > etc",
>> >       "default": {
>> >
>> >       }
>> >     },
>> >     {
>> >       "name": "outlinks",
>> >       "type": {
>> >         "type": "map",
>> >         "values": ["null","string"]
>> >       },
>> >       "doc": "Hyperlinks which direct outside of the current host domain
>> > these can used in a histogram style manner to generate host statistics",
>> >       "default": {
>> >
>> >       }
>> >     },
>> >     {
>> >       "name": "inlinks",
>> >       "type": {
>> >         "type": "map",
>> >         "values": ["null","string"]
>> >       },
>> >       "doc": "Hyperlinks which link to pages within the current host
>> > domain
>> > these can used in a histogram style manner to generate host statistics",
>> >       "default": {
>> >
>> >       }
>> >     }
>> >   ]
>> > }
>> >
>> >
>> > When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
>> > following parse exception
>> >
>> >      [java] Caused by: org.apache.avro.SchemaParseException: No protocol
>> > name specified:
>> >
>> > {"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
>> > represents a store of webpages or other data which resides on a server
>> > or
>> > other computer so that it can be accessed over the
>> >
>> > Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
>> > multivalued metadata container used for storing a wide variety of host
>> > metadata such as structured web server characterists
>> >
>> > etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
>> > which direct outside of the current host domain these can used in a
>> > histogram style manner to generate host
>> >
>> > statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
>> > which link to pages within the current host domain these can used in a
>> > histogram style manner to generate host statistics","default":{}}]}
>> >      [java]     at org.apache.avro.Protocol.parseName(Protocol.java:426)
>> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
>> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
>> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
>> >      [java]     at
>> >
>> > org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
>> >      [java]     at
>> >
>> > org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
>> >      [java]     at
>> >
>> > org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
>> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > Method)
>> >      [java]     at
>> >
>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> >      [java]     at
>> >
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> >      [java]     at java.lang.reflect.Method.invoke(Method.java:606)
>> >      [java]     at
>> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>> >      [java]     at
>> > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>> >      [java]     ... 20 more
>> >      [java] Java Result: -1
>> >
>> > The thing is that I do not wish this to be a Protocol as such, it is
>> > merely
>> > a simple Schema. Can anyone help me out to debug this?
>> > Thank you
>> > Lewis
>> >
>> > --
>> > Lewis
>>
>>
>>
>> --
>> Joey Echeverria
>
>
>
>
> --
> Lewis

Re: Exception No protocol name specified for Record

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hey Joey or anyone else.
Any ideas what is up here? I read through the Avro spec to see if I was
missing something (which I most likely am) but couldn't find a sausage.
Thanks again in advance for any help.
The schema is valid JSON, the stack trace is looking for a Protocol when it
is clearly marked as a Record.

On Tue, Jan 6, 2015 at 2:42 PM, Joey Echeverria <jo...@cloudera.com> wrote:

> Can you send the definition of the ant task that you're using to parse it?
>
> -Joey
>
> On Tue, Jan 6, 2015 at 1:50 PM, Lewis John Mcgibbney
> <le...@gmail.com> wrote:
> > Hi Folks,
> > I have the following small schema
> >
> > {
> >   "name": "Host",
> >   "type": "record",
> >   "namespace": "org.apache.nutch.storage",
> >   "doc": "Host represents a store of webpages or other data which
> resides on
> > a server or other computer so that it can be accessed over the Internet",
> >   "fields": [
> >     {
> >       "name": "metadata",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","bytes"]
> >       },
> >       "doc": "A multivalued metadata container used for storing a wide
> > variety of host metadata such as structured web server characterists
> etc",
> >       "default": {
> >
> >       }
> >     },
> >     {
> >       "name": "outlinks",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","string"]
> >       },
> >       "doc": "Hyperlinks which direct outside of the current host domain
> > these can used in a histogram style manner to generate host statistics",
> >       "default": {
> >
> >       }
> >     },
> >     {
> >       "name": "inlinks",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","string"]
> >       },
> >       "doc": "Hyperlinks which link to pages within the current host
> domain
> > these can used in a histogram style manner to generate host statistics",
> >       "default": {
> >
> >       }
> >     }
> >   ]
> > }
> >
> >
> > When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
> > following parse exception
> >
> >      [java] Caused by: org.apache.avro.SchemaParseException: No protocol
> > name specified:
> >
> {"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
> > represents a store of webpages or other data which resides on a server or
> > other computer so that it can be accessed over the
> >
> Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
> > multivalued metadata container used for storing a wide variety of host
> > metadata such as structured web server characterists
> >
> etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> > which direct outside of the current host domain these can used in a
> > histogram style manner to generate host
> >
> statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> > which link to pages within the current host domain these can used in a
> > histogram style manner to generate host statistics","default":{}}]}
> >      [java]     at org.apache.avro.Protocol.parseName(Protocol.java:426)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >      [java]     at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:606)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> >      [java]     ... 20 more
> >      [java] Java Result: -1
> >
> > The thing is that I do not wish this to be a Protocol as such, it is
> merely
> > a simple Schema. Can anyone help me out to debug this?
> > Thank you
> > Lewis
> >
> > --
> > Lewis
>
>
>
> --
> Joey Echeverria
>



-- 
*Lewis*

Re: Exception No protocol name specified for Record

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Certainly Joey,

 557    <!-- ====================================================== -->
 558   <!-- Generate the Java files from the GORA schemas          -->
 559   <!-- Will call this automatically later                     -->
 560   <!-- ====================================================== -->
 561   <target name="generate-gora-src" depends="init" description="-->
compile the avro schema(s) in src/gora/*.avsc">
 562     <java classname="org.apache.gora.compiler.GoraCompiler">
 563      <classpath refid="classpath"/>
 564      <!--arg value="src/gora/webpage.avsc"/-->
 565      <arg value="src/gora/host.avsc"/>
 566      <arg value="${src.dir}"/>
 567     </java>
 568  </target>

The GoraCompiler I am using can be found here

https://github.com/apache/gora/blob/apache-gora-0.5/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java

Thanks for any heads up here. The problem was introduced after I added
"doc": attributes to fields in the Schema.
Lewis

On Tue, Jan 6, 2015 at 2:42 PM, Joey Echeverria <jo...@cloudera.com> wrote:

> Can you send the definition of the ant task that you're using to parse it?
>
> -Joey
>
> On Tue, Jan 6, 2015 at 1:50 PM, Lewis John Mcgibbney
> <le...@gmail.com> wrote:
> > Hi Folks,
> > I have the following small schema
> >
> > {
> >   "name": "Host",
> >   "type": "record",
> >   "namespace": "org.apache.nutch.storage",
> >   "doc": "Host represents a store of webpages or other data which
> resides on
> > a server or other computer so that it can be accessed over the Internet",
> >   "fields": [
> >     {
> >       "name": "metadata",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","bytes"]
> >       },
> >       "doc": "A multivalued metadata container used for storing a wide
> > variety of host metadata such as structured web server characterists
> etc",
> >       "default": {
> >
> >       }
> >     },
> >     {
> >       "name": "outlinks",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","string"]
> >       },
> >       "doc": "Hyperlinks which direct outside of the current host domain
> > these can used in a histogram style manner to generate host statistics",
> >       "default": {
> >
> >       }
> >     },
> >     {
> >       "name": "inlinks",
> >       "type": {
> >         "type": "map",
> >         "values": ["null","string"]
> >       },
> >       "doc": "Hyperlinks which link to pages within the current host
> domain
> > these can used in a histogram style manner to generate host statistics",
> >       "default": {
> >
> >       }
> >     }
> >   ]
> > }
> >
> >
> > When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
> > following parse exception
> >
> >      [java] Caused by: org.apache.avro.SchemaParseException: No protocol
> > name specified:
> >
> {"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
> > represents a store of webpages or other data which resides on a server or
> > other computer so that it can be accessed over the
> >
> Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
> > multivalued metadata container used for storing a wide variety of host
> > metadata such as structured web server characterists
> >
> etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> > which direct outside of the current host domain these can used in a
> > histogram style manner to generate host
> >
> statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> > which link to pages within the current host domain these can used in a
> > histogram style manner to generate host statistics","default":{}}]}
> >      [java]     at org.apache.avro.Protocol.parseName(Protocol.java:426)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
> >      [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
> >      [java]     at
> >
> org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >      [java]     at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:606)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> >      [java]     ... 20 more
> >      [java] Java Result: -1
> >
> > The thing is that I do not wish this to be a Protocol as such, it is
> merely
> > a simple Schema. Can anyone help me out to debug this?
> > Thank you
> > Lewis
> >
> > --
> > Lewis
>
>
>
> --
> Joey Echeverria
>



-- 
*Lewis*

Re: Exception No protocol name specified for Record

Posted by Joey Echeverria <jo...@cloudera.com>.
Can you send the definition of the ant task that you're using to parse it?

-Joey

On Tue, Jan 6, 2015 at 1:50 PM, Lewis John Mcgibbney
<le...@gmail.com> wrote:
> Hi Folks,
> I have the following small schema
>
> {
>   "name": "Host",
>   "type": "record",
>   "namespace": "org.apache.nutch.storage",
>   "doc": "Host represents a store of webpages or other data which resides on
> a server or other computer so that it can be accessed over the Internet",
>   "fields": [
>     {
>       "name": "metadata",
>       "type": {
>         "type": "map",
>         "values": ["null","bytes"]
>       },
>       "doc": "A multivalued metadata container used for storing a wide
> variety of host metadata such as structured web server characterists etc",
>       "default": {
>
>       }
>     },
>     {
>       "name": "outlinks",
>       "type": {
>         "type": "map",
>         "values": ["null","string"]
>       },
>       "doc": "Hyperlinks which direct outside of the current host domain
> these can used in a histogram style manner to generate host statistics",
>       "default": {
>
>       }
>     },
>     {
>       "name": "inlinks",
>       "type": {
>         "type": "map",
>         "values": ["null","string"]
>       },
>       "doc": "Hyperlinks which link to pages within the current host domain
> these can used in a histogram style manner to generate host statistics",
>       "default": {
>
>       }
>     }
>   ]
> }
>
>
> When I use Avro 1.7.6 to parse it via an Ant task, I am getting the
> following parse exception
>
>      [java] Caused by: org.apache.avro.SchemaParseException: No protocol
> name specified:
> {"name":"Host","type":"record","namespace":"org.apache.nutch.storage","doc":"Host
> represents a store of webpages or other data which resides on a server or
> other computer so that it can be accessed over the
> Internet","fields":[{"name":"metadata","type":{"type":"map","values":["null","bytes"]},"doc":"A
> multivalued metadata container used for storing a wide variety of host
> metadata such as structured web server characterists
> etc","default":{}},{"name":"outlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> which direct outside of the current host domain these can used in a
> histogram style manner to generate host
> statistics","default":{}},{"name":"inlinks","type":{"type":"map","values":["null","string"]},"doc":"Hyperlinks
> which link to pages within the current host domain these can used in a
> histogram style manner to generate host statistics","default":{}}]}
>      [java]     at org.apache.avro.Protocol.parseName(Protocol.java:426)
>      [java]     at org.apache.avro.Protocol.parse(Protocol.java:399)
>      [java]     at org.apache.avro.Protocol.parse(Protocol.java:390)
>      [java]     at org.apache.avro.Protocol.parse(Protocol.java:361)
>      [java]     at
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:248)
>      [java]     at
> org.apache.avro.compiler.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:238)
>      [java]     at
> org.apache.avro.compiler.specific.SpecificCompiler.main(SpecificCompiler.java:719)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>      [java]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:606)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>      [java]     ... 20 more
>      [java] Java Result: -1
>
> The thing is that I do not wish this to be a Protocol as such, it is merely
> a simple Schema. Can anyone help me out to debug this?
> Thank you
> Lewis
>
> --
> Lewis



-- 
Joey Echeverria