Hi Yeah this sounds like a issue in OSGi land. I have logged a ticket https://issues.apache.org/jira/browse/CAMEL-7001
On Fri, Nov 22, 2013 at 4:15 PM, mabels <meno.ab...@adviser.com> wrote: > Hey, > > 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 = > context.getClassResolver().resolveMandatoryClass(className); > 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 > > if > (context.getClassResolver().resolveMandatoryClass("GenericContainer").isAssignableFrom(instanceClass)) > > thx in advance > > meno > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/OSGI-camel-avro-2-12-1-AvroDataFormat-loadDefaultSchema-tp5743694.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen