After I created a Java EE web application archive, the method isAnnotationPresent() returns false when I call the following code, while it works fine in plain Java SE. The Method should find all Tests from a Class. The following Method is in a seperated component.
for (Method m : clazz.getDeclaredMethods()) {
// only method with @Test
if (m.isAnnotationPresent(Test.class)) {
I've tried to do it with the full class name and its the same result. When I iterate over all Annotations via m.getAnnotations() and print it, then the Annotation is present.
Could this be a Classloader problem?
Aucun commentaire:
Enregistrer un commentaire