You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.NoSuchMethodError: org.reflections.util.FilterBuilder.excludePattern(Ljava/lang/String;)Lorg/reflections/util/FilterBuilder;
at org.reflections.scanners.Scanners$1.(Scanners.java:50)
at org.reflections.scanners.Scanners.(Scanners.java:48)
at deba.demo.ClasspathAnalyzer.getScannerArray(ClasspathAnalyzer.java:31)
at deba.demo.ClasspathAnalyzer.(ClasspathAnalyzer.java:24)
at deba.demo.ClassPathScanner.main(ClassPathScanner.java:17)
My main method class
public class ClassPathScanner {
public static void main(String[] args) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
ClasspathAnalyzer analyzer = new ClasspathAnalyzer(loader , new String[] {"org.appops", "deba.demo.test"});
Reflections sstore = analyzer.getReflectStore();
Set<Class<?>> classes = sstore.getTypesAnnotatedWith(TestOp.class);
for (Class<?> clazz : classes) {
Method[] m = clazz.getMethods();
for (Method me : m) {
Parameter[] pars = me.getParameters();
for (Parameter par : pars) {
System.out.println( "Found parameter name on - " + clazz.getSimpleName() + "."+ me.getName()+ "." + par.getName());
}
}
}
}
}
Class that builds the Reflections Object
public class ClasspathAnalyzer {
private Reflections refStore = null ;
public ClasspathAnalyzer(ClassLoader clsloader , String[] packrefs) {
ConfigurationBuilder builder = new ConfigurationBuilder() ;
builder.addClassLoaders(clsloader) ;
builder.forPackages(packrefs);
builder.setScanners(getScannerArray());
refStore = new Reflections(builder);
}
private Scanner[] getScannerArray() {
Set<Scanner> scanners = new HashSet<>(Arrays.asList(Scanners.TypesAnnotated, Scanners.SubTypes,
Scanners.FieldsAnnotated, Scanners.MethodsAnnotated, new MethodParameterNamesScanner(),
new TypeElementsScanner(), Scanners.MethodsSignature, Scanners.MethodsParameter));
return scanners.toArray(new Scanner[scanners.size()]);
}
public Reflections getReflectStore() {
return refStore ;
}
}
The text was updated successfully, but these errors were encountered:
Exception in thread "main" java.lang.NoSuchMethodError: org.reflections.util.FilterBuilder.excludePattern(Ljava/lang/String;)Lorg/reflections/util/FilterBuilder;
at org.reflections.scanners.Scanners$1.(Scanners.java:50)
at org.reflections.scanners.Scanners.(Scanners.java:48)
at deba.demo.ClasspathAnalyzer.getScannerArray(ClasspathAnalyzer.java:31)
at deba.demo.ClasspathAnalyzer.(ClasspathAnalyzer.java:24)
at deba.demo.ClassPathScanner.main(ClassPathScanner.java:17)
My main method class
public class ClassPathScanner {
}
Class that builds the Reflections Object
public class ClasspathAnalyzer {
}
The text was updated successfully, but these errors were encountered: