mardi 24 octobre 2017

Java reflection with Serve modules without publishing

I have a problem with reflection on Web Application using com.google.common.reflect.ClassPath. And see below for my sample code.

ClassLoader loader = Thread.currentThread().getContextClassLoader();
ImmutableSet<ClassInfo> classInfos = ClassPath.from(loader).getTopLevelClassesRecursive(PATH);

Basically getTopLevelClassesRecursive returns as I expected, but when using it with 'Serve modules without publishing', it returns nothing.

Reading from the questions below, I guess the cause of it is deference of the scope of WebAppClassLoader between using 'Serve modules without publishing' and not using it.

Technical details of serve modules without publishing in Eclipse WTP and Tomcat?

Dose anybody have an idea to solve this problem?





Aucun commentaire:

Enregistrer un commentaire