quarkusio/quarkus · error · IllegalArgumentException

The serviceDescriptorFile interface cannot be blank

Error message

The serviceDescriptorFile interface cannot be blank

What it means

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.)

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java:188

    public ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers) {
        this(serviceInterfaceClassName, List.copyOf(providers), false);
    }

    /**
     * An internal overload that must be called with an immutable {@link List} of {@code providers}
     *
     * @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed
     * @param providers the list of provider class names that must already be mentioned in the file
     * @param marker just a way to differentiate this constructor from {@link #ServiceProviderBuildItem(String, List)};
     *        the value is ignored
     */
    private ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers, boolean marker) {
        this.serviceInterface = Objects.requireNonNull(serviceInterfaceClassName, "The service interface must not be `null`");
        this.providers = providers;

        // Validation
        if (serviceInterface.isEmpty()) {
            throw new IllegalArgumentException("The serviceDescriptorFile interface cannot be blank");
        }

        providers.forEach(s -> {
            if (s == null || s.isEmpty()) {
                throw new IllegalArgumentException("The provider class name cannot be null or blank");
            }
        });
    }

    /**
     * @return an immutable {@link List} of provider class names
     */
    public List<String> providers() {
        return providers;
    }

    /**
     * @return the resource path for the service descriptor file

View on GitHub (pinned to e1c734241f)

Solutions

  1. Pass a non-empty fully-qualified service interface name
  2. Use the public constructors/factories which validate inputs earlier
  3. Check upstream values for empty strings

Example fix

// before
new ServiceProviderBuildItem("", List.of("com.example.Impl"));
// after
new ServiceProviderBuildItem("com.example.MySpi", List.of("com.example.Impl"));
Defensive patterns

Strategy: validation

Validate before calling

if (serviceInterfaceClassName == null || serviceInterfaceClassName.isEmpty()) throw new IllegalStateException("SPI interface name required");

Type guard

boolean isValidSpiName(String s) { return s != null && !s.isEmpty(); }

Prevention

When it happens

Trigger: Creating a ServiceProviderBuildItem with "" as serviceInterfaceClassName via any public constructor/factory path that skips the earlier blank checks.

Common situations: Constructing the build item directly in a custom build step with a computed but empty interface name.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/c355bf341359a922. Report an issue: GitHub.