Hi, I have created https://issues.apache.org/jira/browse/AVRO-1571 to track this. It shows a little bit more complex version of the problem and a possible solution.
Thanks - Sachin From: S G <sg.online.em...@gmail.com<mailto:sg.online.em...@gmail.com>> Reply-To: "user@avro.apache.org<mailto:user@avro.apache.org>" <user@avro.apache.org<mailto:user@avro.apache.org>> Date: Friday, August 22, 2014 at 11:45 AM To: "user@avro.apache.org<mailto:user@avro.apache.org>" <user@avro.apache.org<mailto:user@avro.apache.org>> Subject: How to handle entities with type-parameters Hi, Does anyone know how I can avoid an exception for the following code: ------------------------------------------------------------------- public class EntityWrapper<T> { T obj; } public class Entity { Integer a = 1; String b = "Foo"; } EntityWrapper<Entity> en = new EntityWrapper<Entity>(); en.obj = new Entity(); ReflectData.getSchema(en.getClass()); ------------------------------------------------------------------- And the exception is: org.apache.avro.AvroTypeException: Unknown type: T at org.apache.avro.specific.SpecificData.createSchema(SpecificData.java:260) at org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:542) at org.apache.avro.reflect.ReflectData.createFieldSchema(ReflectData.java:645) at org.apache.avro.reflect.ReflectData$AllowNull.createFieldSchema(ReflectData.java:78) at org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:500) at org.apache.avro.specific.SpecificData.getSchema(SpecificData.java:194) Thx - Sachin