I have a case where a component is introspecting classes, namely looking for fields with @OpenEngSBModelId, at runtime.
In a pax-exam itest, I use the TestModel classes via TestModelDecorator. The class is effectively retrieved via modelDecorator.getModel().getClass(). Once in the introspection routine of the bundle, all annotations are gone from the class, methods and fields. I can get methods and fields via reflection from the class, but they have no annotations.
I'm assuming that this has something to do with pax-exam, the test scope and the class loading mechanisms, but I don't understand how this can affect only annotations.
Any ideas?
BR,
Thomas