I have a sub-interface that extends my @IndexSubclassesinterface, that class gets added to the META-INF/services file. This causes an exception in the application at runtime.
Classindex: v3.9
java.util.ServiceConfigurationError: com.example.Interface: Provider com.example.SubInterface could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.example.Registry.init(Registry.java:78)
... plenty more
Caused by: java.lang.InstantiationException: com.example.SubInterface
at java.lang.Class.newInstance(Class.java:427)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
... 73 more
Caused by: java.lang.NoSuchMethodException: com.example.SubInterface.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
... 74 more
Test-Sourcen
@IndexSubclasses
public interface IndexedInterface {
}
public interface SubInterface extends IndexedInterface {
}
I have a sub-interface that extends my
@IndexSubclasses
interface
, that class gets added to theMETA-INF/services
file. This causes an exception in the application at runtime.Classindex: v3.9
Test-Sourcen