{"record":{"id":"c355bf341359a922","repo":"quarkusio/quarkus","slug":"the-servicedescriptorfile-interface-cannot-be-blan","errorCode":null,"errorMessage":"The serviceDescriptorFile interface cannot be blank","messagePattern":"The serviceDescriptorFile interface cannot be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java","lineNumber":188,"sourceCode":"    public ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers) {\n        this(serviceInterfaceClassName, List.copyOf(providers), false);\n    }\n\n    /**\n     * An internal overload that must be called with an immutable {@link List} of {@code providers}\n     *\n     * @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed\n     * @param providers the list of provider class names that must already be mentioned in the file\n     * @param marker just a way to differentiate this constructor from {@link #ServiceProviderBuildItem(String, List)};\n     *        the value is ignored\n     */\n    private ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers, boolean marker) {\n        this.serviceInterface = Objects.requireNonNull(serviceInterfaceClassName, \"The service interface must not be `null`\");\n        this.providers = providers;\n\n        // Validation\n        if (serviceInterface.isEmpty()) {\n            throw new IllegalArgumentException(\"The serviceDescriptorFile interface cannot be blank\");\n        }\n\n        providers.forEach(s -> {\n            if (s == null || s.isEmpty()) {\n                throw new IllegalArgumentException(\"The provider class name cannot be null or blank\");\n            }\n        });\n    }\n\n    /**\n     * @return an immutable {@link List} of provider class names\n     */\n    public List<String> providers() {\n        return providers;\n    }\n\n    /**\n     * @return the resource path for the service descriptor file","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java#L170-L206","documentation":"The private ServiceProviderBuildItem constructor validates the service interface name is not empty after checking non-null via Objects.requireNonNull; an empty string yields this IllegalArgumentException. (The message says 'serviceDescriptorFile' but refers to the service interface name.)","triggerScenarios":"Creating a ServiceProviderBuildItem with \"\" as serviceInterfaceClassName via any public constructor/factory path that skips the earlier blank checks.","commonSituations":"Constructing the build item directly in a custom build step with a computed but empty interface name.","solutions":["Pass a non-empty fully-qualified service interface name","Use the public constructors/factories which validate inputs earlier","Check upstream values for empty strings"],"exampleFix":"// before\nnew ServiceProviderBuildItem(\"\", List.of(\"com.example.Impl\"));\n// after\nnew ServiceProviderBuildItem(\"com.example.MySpi\", List.of(\"com.example.Impl\"));","handlingStrategy":"validation","validationCode":"if (serviceInterfaceClassName == null || serviceInterfaceClassName.isEmpty()) throw new IllegalStateException(\"SPI interface name required\");","typeGuard":"boolean isValidSpiName(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":null,"preventionTips":["Never construct ServiceProviderBuildItem with empty strings","Use the public factory methods with built-in validation","Sanitize names derived from config or parsing"],"tags":["native-image","spi","validation"],"backgroundTag":"invalid-argument-null-or-blank","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}