julianpeeters / avrohugger

Generate Scala case class definitions from Avro schemas
Apache License 2.0
201 stars 120 forks source link

Improve error messages arround importing schemas in idls #40

Closed anayyar82 closed 8 years ago

anayyar82 commented 8 years ago

Exception in thread "main" java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at scala.collection.convert.Wrappers$JConcurrentMapWrapper.get(Wrappers.scala:350) at avrohugger.format.abstractions.Importer$class.checkNamespace$1(Importer.scala:56) at avrohugger.format.abstractions.Importer$$anonfun$getRecordImports$2.apply(Importer.scala:66) at avrohugger.format.abstractions.Importer$$anonfun$getRecordImports$2.apply(Importer.scala:66) at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263) at scala.collection.AbstractTraversable.filter(Traversable.scala:105) at avrohugger.format.abstractions.Importer$class.getRecordImports(Importer.scala:66) at avrohugger.format.specific.SpecificImporter$.getRecordImports(SpecificImporter.scala:20) at avrohugger.format.specific.SpecificImporter$.getImports(SpecificImporter.scala:32) at avrohugger.format.specific.SpecificScalaTreehugger$.asScalaCodeString(SpecificScalaTreehugger.scala:36) at avrohugger.format.abstractions.SourceFormat$class.getScalaCompilationUnit(SourceFormat.scala:147) at avrohugger.format.SpecificRecord$.getScalaCompilationUnit(SpecificRecord.scala:19) at avrohugger.format.SpecificRecord$.asCompilationUnits(SpecificRecord.scala:86) at avrohugger.format.SpecificRecord$.compile(SpecificRecord.scala:164) at avrohugger.FileGenerator$$anonfun$schemaToFile$1.apply(FileGenerator.scala:35) at avrohugger.FileGenerator$$anonfun$schemaToFile$1.apply(FileGenerator.scala:32) at scala.collection.immutable.List.foreach(List.scala:318) at avrohugger.FileGenerator$.schemaToFile(FileGenerator.scala:32) at avrohugger.FileGenerator$$anonfun$fileToFile$1.apply(FileGenerator.scala:83) at avrohugger.FileGenerator$$anonfun$fileToFile$1.apply(FileGenerator.scala:81) at scala.collection.immutable.List.foreach(List.scala:318) at avrohugger.FileGenerator$.fileToFile(FileGenerator.scala:81) at avrohugger.Generator.fileToFile(Generator.scala:77) at test.Testing$.main(Testing.scala:21) at test.Testing.main(Testing.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

julianpeeters commented 8 years ago

Hi @anayyar82,

Thanks for reporting this and sorry that you ran into issues.

I've never run into this error before, and I'm unable to reproduce it without more info. Is it possible that you share your project or your schema/idl so I can investigate what may have caused this?

anayyar82 commented 8 years ago

Thanks Julian.. I found that error, it was avsc file issue. but it's perfectly working fine now :)

what a great tool you have given to community.

julianpeeters commented 8 years ago

Great! Thanks for kicking the tires. You all really do improve this project greatly by using it and reporting rough edges like this. :)

anayyar82 commented 8 years ago

​Do you have any tool which generate XSD or XML to avsc (avro schema file)​

On Wed, Aug 17, 2016 at 6:04 PM, Julian Peeters notifications@github.com wrote:

Great! Thanks for kicking the tires. You all really do improve this project greatly by using it and reporting rough edges like this. :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/julianpeeters/avrohugger/issues/40#issuecomment-240575870, or mute the thread https://github.com/notifications/unsubscribe-auth/AE9a0rU4aTza8T9R88FffXivKMf1FKQUks5qg5N9gaJpZM4Jlcsd .

Thanks, Ankur Nayyar, 9802194760

julianpeeters commented 8 years ago

No, I'm unaware of any such tools. Maybe there exists an xsd tool that could probably be used in conjunction with Apache Avro SchemaBuilder, then some logic like avrohugger to handle arbitrary xsd.

On Aug 18, 2016 11:52 AM, "anayyar82" notifications@github.com wrote:

​Do you have any tool which generate XSD or XML to avsc (avro schema file)​

On Wed, Aug 17, 2016 at 6:04 PM, Julian Peeters notifications@github.com wrote:

Great! Thanks for kicking the tires. You all really do improve this project greatly by using it and reporting rough edges like this. :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/julianpeeters/avrohugger/issues/40#issuecomment- 240575870, or mute the thread https://github.com/notifications/unsubscribe-auth/ AE9a0rU4aTza8T9R88FffXivKMf1FKQUks5qg5N9gaJpZM4Jlcsd .

Thanks, Ankur Nayyar, 9802194760

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/julianpeeters/avrohugger/issues/40#issuecomment-240820346, or mute the thread https://github.com/notifications/unsubscribe-auth/AAj_Lnc-m49PB-upkJGLatyIlgr0Az5-ks5qhKncgaJpZM4Jlcsd .