Return-Path: Delivered-To: apmail-avro-user-archive@www.apache.org Received: (qmail 9784 invoked from network); 2 Aug 2010 16:00:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Aug 2010 16:00:12 -0000 Received: (qmail 68676 invoked by uid 500); 2 Aug 2010 16:00:12 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 68627 invoked by uid 500); 2 Aug 2010 16:00:12 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 68619 invoked by uid 99); 2 Aug 2010 16:00:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 16:00:11 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Aug 2010 16:00:11 +0000 Received: (qmail 9501 invoked by uid 99); 2 Aug 2010 15:59:51 -0000 Received: from localhost.apache.org (HELO [192.168.168.134]) (127.0.0.1) (smtp-auth username cutting, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Aug 2010 15:59:51 +0000 Message-ID: <4C56EB76.5030202@apache.org> Date: Mon, 02 Aug 2010 08:59:50 -0700 From: Doug Cutting User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: user@avro.apache.org Subject: Re: Undefined name: "enum" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The sourceComponentTypeField should look something like: {"name": "sourceComponentType", "type": {"type": "enum", "symbols": [ ... ] } } This is the same error message that confused Sam in: https://issues.apache.org/jira/browse/AVRO-583 Doug On 08/02/2010 08:46 AM, Tim Robertson wrote: > Hi all, > > I am new to avro, and using it to implement an http RPC transport > layer to allow distributed components to push to a centralised event > log. > > I have the following types in my .avpr: > > "types": [ > {"name": "Event", "type": "record", > "fields": [ > {"name": "message", "type": "string"}, > { > "type": "enum", > "name": "sourceComponentType", > "symbols" : ["OCCURRENCE_HARVESTER", "CHECKLIST_HARVESTER", "USER"] > }, > {"name": "instanceId", "type": "string"}, > {"name": "sessionId", "type": "string", "default": null}, > {"name": "count", "type": "int", "default": 0}, > {"name": "sourceId", "type": "string"}, > {"name": "userId", "type": "string"}, > { > "type": "enum", > "name": "level", > "symbols" : ["DEBUG", "INFO", "WARN", "ERROR"] > }, > {"name": "agentId", "type": "string"}, > { > "type": "enum", > "name": "objectType", > "symbols" : ["OCCURRENCE", "NAME_USAGE"] > }, > {"name": "objectId", "type": "string"}, > {"name": "message", "type": "string"}, > {"name": "sensitive", "type": "boolean", "default": "false"} > ] > } > > but on protocol compilation get: > > org.apache.avro.SchemaParseException: Undefined name: "enum" > at org.apache.avro.Schema.parse(Schema.java:876) > at org.apache.avro.Schema.parse(Schema.java:912) > at org.apache.avro.Protocol.parseTypes(Protocol.java:325) > at org.apache.avro.Protocol.parse(Protocol.java:288) > at org.apache.avro.Protocol.parse(Protocol.java:278) > at org.apache.avro.Protocol.parse(Protocol.java:262) > at org.apache.avro.specific.SpecificCompiler.compileProtocol(SpecificCompiler.java:104) > at org.apache.avro.mojo.AvroMojo.execute(AvroMojo.java:163) > at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) > at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > > > Can someone spot an error please? I'm on 1.3.3 and just copied the > example in the docs on > http://avro.apache.org/docs/1.3.3/spec.html#Enums > > Thanks, > Tim