Skip to content

Commit

Permalink
Fix native issue with @providers when only the REST Client exists
Browse files Browse the repository at this point in the history
When the server part of Quarkus REST is not included, prior to
this change, user's @Provider classes were not registered
for reflection

Relates to: quarkiverse/quarkus-langchain4j#722
  • Loading branch information
geoand committed Jul 5, 2024
1 parent c1f0a74 commit 2a567df
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem,
int.class),
constructor.getThis(), constructor.loadClassFromTCCL(providerDotName.toString()),
constructor.load(priority));

// when the server is not included, providers are not automatically registered for reflection,
// so we need to always do it for the client to be on the safe side
reflectiveClassesProducer.produce(ReflectiveClassBuildItem.builder(providerDotName.toString()).build());
}
}

Expand Down

0 comments on commit 2a567df

Please sign in to comment.