Skip to content

Commit

Permalink
Change class loading when adding the listeners.
Browse files Browse the repository at this point in the history
  • Loading branch information
juazugas committed Oct 12, 2020
1 parent 8a5a020 commit aee8c58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CommandListenerBuildItem collectCommandListeners(CombinedIndexBuildItem indexBui
}

@BuildStep
List<ReflectiveClassBuildItem> addCodecsAndDiscriminatorsAndListenersToNative(CodecProviderBuildItem codecProviders,
List<ReflectiveClassBuildItem> addExtensionPointsToNative(CodecProviderBuildItem codecProviders,
BsonDiscriminatorBuildItem bsonDiscriminators,
CommandListenerBuildItem commandListeners) {
List<String> reflectiveClassNames = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ private List<CommandListener> getCommandListeners(List<String> classNames) {
List<CommandListener> listeners = new ArrayList<>();
for (String name : classNames) {
try {
Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(name);
Class<?> clazz = Class.forName(name);
Constructor clazzConstructor = clazz.getConstructor();
listeners.add((CommandListener) clazzConstructor.newInstance());
} catch (Exception e) {
Expand Down

0 comments on commit aee8c58

Please sign in to comment.