File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
sdk-core/src/main/java/dev/restate/sdk/core Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -223,10 +223,21 @@ private static class ServiceDefinitionFactoryDiscovery {
223223 private final List <ServiceDefinitionFactory > factories ;
224224
225225 private ServiceDefinitionFactoryDiscovery () {
226- this .factories =
227- ServiceLoader .load (ServiceDefinitionFactory .class ).stream ()
228- .map (ServiceLoader .Provider ::get )
229- .collect (Collectors .toList ());
226+ this .factories = new ArrayList <>();
227+
228+ var serviceLoaderIterator = ServiceLoader .load (ServiceDefinitionFactory .class ).iterator ();
229+ while (serviceLoaderIterator .hasNext ()) {
230+ try {
231+ this .factories .add (serviceLoaderIterator .next ());
232+ } catch (ServiceConfigurationError | Exception e ) {
233+ LOG .debug (
234+ "Found service that cannot be loaded using service provider. "
235+ + "You can ignore this message during development.\n "
236+ + "This might be the result of using a compiler with incremental builds (e.g. IntelliJ IDEA) "
237+ + "that updated a dirty META-INF file after removing/renaming an annotated service." ,
238+ e );
239+ }
240+ }
230241 }
231242
232243 private @ Nullable ServiceDefinitionFactory discoverFactory (Object service ) {
You can’t perform that action at this time.
0 commit comments