Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/985#discussion_r180755523 --- Diff: metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/resolver/ClasspathFunctionResolver.java --- @@ -254,18 +266,24 @@ public void initialize(Context context) { Set<String> classes = new HashSet<>(); Set<Class<? extends StellarFunction>> ret = new HashSet<>(); for(ClassLoader cl : cls) { - for(Class<?> c : ClassIndex.getAnnotated(Stellar.class, cl)) { - LOG.debug("{}: Found class: {}", cl.getClass().getCanonicalName(), c.getCanonicalName()); - boolean isAssignable = StellarFunction.class.isAssignableFrom(c); - boolean isFiltered = filterBuilder.apply(c.getCanonicalName()); - if( isAssignable && isFiltered ) { - String className = c.getName(); - if(!classes.contains(className)) { - LOG.debug("{}: Added class: {}", cl.getClass().getCanonicalName(), className); - ret.add((Class<? extends StellarFunction>) c); - classes.add(className); + for(Class<?> c : getStellarClasses(cl)) { + try { + LOG.debug("{}: Found class: {}", cl.getClass().getCanonicalName(), c.getCanonicalName()); + if (includeClass(c, filterBuilder)) { + String className = c.getName(); + if (!classes.contains(className)) { + LOG.debug("{}: Added class: {}", cl.getClass().getCanonicalName(), className); + ret.add((Class<? extends StellarFunction>) c); + classes.add(className); + } } } + catch(Error le) { + //we have had some error loading a stellar function. This could mean that + //the classpath is unstable (e.g. old copies of jars are on the classpath). + LOG.error("Skipping class: " + le.getMessage() --- End diff -- We use commons-lang <= [2.6](http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/ClassUtils.html), which does not have that method. I'd prefer to not update as part of this PR as it seems to me to be an overreach from a risk perspective.
---