diff --git a/core/common/boot/src/main/java/org/eclipse/edc/boot/system/injection/ConfigurationInjectionPoint.java b/core/common/boot/src/main/java/org/eclipse/edc/boot/system/injection/ConfigurationInjectionPoint.java index 69419e7279..d857435d44 100644 --- a/core/common/boot/src/main/java/org/eclipse/edc/boot/system/injection/ConfigurationInjectionPoint.java +++ b/core/common/boot/src/main/java/org/eclipse/edc/boot/system/injection/ConfigurationInjectionPoint.java @@ -126,12 +126,14 @@ public Object resolve(ServiceExtensionContext context, DefaultServiceSupplier de field.setAccessible(true); field.set(instance, fe.value()); } catch (IllegalAccessException | NoSuchFieldException e) { - throw new RuntimeException(e); + throw new EdcInjectionException(e); } }); return instance; - } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | + } catch (NoSuchMethodException e) { + throw new EdcInjectionException("Configuration objects must declare a default constructor, but '%s' does not.".formatted(configurationObject.getType())); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new EdcInjectionException(e); }