pinpoint-apm/pinpoint · error · IllegalArgumentException

service type name must not be empty

Error message

service type name must not be empty

What it means

ParsedServiceType.toServiceTypeInfo() converts a YAML-declared service type into a ServiceTypeInfo. It first asserts that the numeric code is present, then that the string name is non-empty. A service type entry in a type-provider YAML with an empty or missing 'name' field cannot be registered, so an IllegalArgumentException is thrown.

Source

Thrown at agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedServiceType.java:83

    }

    public void setProperty(ParsedServiceTypeProperty property) {
        this.property = property;
    }

    public ParsedAnnotationKeyMatcher getMatcher() {
        return matcher;
    }

    public void setMatcher(ParsedAnnotationKeyMatcher matcher) {
        this.matcher = matcher;
    }

    ServiceTypeInfo toServiceTypeInfo() {
        Objects.requireNonNull(code, "code");

        if (StringUtils.isEmpty(name)) {
            throw new IllegalArgumentException("service type name must not be empty");
        }
        ServiceTypeBuilder builder;
        if (StringUtils.isEmpty(desc)) {
            builder = new ServiceTypeBuilder(code, name);
        } else {
            builder = new ServiceTypeBuilder(code, name, desc);
        }
        if (property != null) {
            builder.terminal(property.isTerminal());
            builder.queue(property.isQueue());
            builder.recordStatistics(property.isRecordStatistics());
            builder.includeDestinationId(property.isIncludeDestinationId());
            builder.alias(property.isAlias());
        }
        ServiceType serviceType = builder.build();

        if (matcher == null) {
            return new DefaultServiceTypeInfo(serviceType);

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Open the offending type-provider YAML and give the serviceTypes entry a non-empty 'name' value
  2. Check the key spelling is exactly 'name' (YAML is case-sensitive)
  3. Verify no build/profile substitution (Maven/Gradle filtering, env vars) is blanking the value
  4. Add CI validation that parses the YAML with this parser before shipping the plugin

Example fix

// before (type-provider.yml)
serviceTypes:
  - code: 1000
    name: ""
// after
serviceTypes:
  - code: 1000
    name: "MY_SERVICE"
Defensive patterns

Strategy: validation

Validate before calling

if (name == null || name.trim().isEmpty()) {
    throw new IllegalArgumentException("service type name must not be empty");
}
// or in YAML tooling: assert entry.get("name") is a non-blank string before shipping

Type guard

boolean hasNonEmptyName(Map<String,Object> entry) {
    Object n = entry.get("name");
    return n instanceof String && !((String) n).trim().isEmpty();
}

Prevention

When it happens

Trigger: A type-provider YAML file contains a serviceTypes entry whose 'name' key is absent or set to "" (or whitespace), while 'code' is valid.

Common situations: Plugin authors hand-editing type-provider yml files; typo'd key names (e.g. 'serviceName' instead of 'name'); template placeholders like ${NAME} left unresolved or overridden to empty by build/env substitution.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/bb1e357467d59b77. Report an issue: GitHub.