camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mabels <>
Subject OSGI camel-avro:2.12.1 AvroDataFormat:loadDefaultSchema
Date Fri, 22 Nov 2013 15:15:30 GMT

we use camel-avro on osgi-karaf. We use the OsgiDefaultContext and in a
marshal(routentry) we get during runtime the exception:

Can't set the shcema of AvroDataFormat with "+ className + ", as the class
is not a subClass of SpecificData"

so we try to figure out whats going on there and discovered this code in:

 protected Schema loadDefaultSchema(String className, CamelContext context)
throws CamelException, ClassNotFoundException {
       Class<?> instanceClass =
       if (GenericContainer.class.isAssignableFrom(instanceClass)) {

and the isAssignableFrom methode returns falsce in our case. This is happen
due to the fact that the 
instanceClass is returned from the classloader which is related to the
OsgiDefaultContext. And the
classloader GenericContainer.class make us is the classloader of the
camel-avro bundle. So both 
class instances are not from the same classloader and  isAssignableFrom
returns false. 

I currently not understand how to solve this in loadDefaultSchema it should
be something like


thx in advance


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message