avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shashi kumar <kshashi...@gmail.com>
Subject Fwd: Converting xml to avro and getting back the same xml from avro.
Date Tue, 23 May 2017 06:05:46 GMT
---------- Forwarded message ----------
From: shashi kumar <kshashi205@gmail.com>
Date: Tue, May 23, 2017 at 11:20 AM
Subject: Fwd: Converting xml to avro and getting back the same xml from
avro.
To: user-info@avro.apache.org, user-faq@avro.apache.org



---------- Forwarded message ----------
From: shashi kumar <kshashi205@gmail.com>
Date: Mon, May 22, 2017 at 6:46 PM
Subject: Converting xml to avro and getting back the same xml from avro.



Hello All,

Github source code used.
https://github.com/elodina/xml-avro

By using the above source, i am able to generate the avro schema (.avsc
file )
and avro file by giving xsd and xml.

While i need to generate back the xml from the avro file generated.
It is giving the error as "Exception in thread "main"
java.lang.ExceptionInInitializerError
Caused by: org.apache.avro.SchemaParseException: No protocol name
specified: "

Then in the avro schema i gave the protocol has :

"namespace": "xs",

  "protocol": "HelloWorld",

  "doc": "Protocol Greetings",



Or


"namespace": "http://www.w3.org/2001/XMLSchema",

  "protocol": "HelloWorld",

  "doc": "Protocol Greetings",


I tried giving this protocol and tried to generate the xml from the avro.

i got another error:

Exception in thread "main" java.util.NoSuchElementException


Is there any better solution for this ?.



Attachment:
student_2.xml and xml_2.xsd is used for generating the avro schema and avro
file.
After getting the avro file, i tried the avro schema generated and avro
file to generate back the xml.


Thanks,

Shashi

Mime
View raw message