pinpoint-apm/pinpoint · error

ObjectName validation failed

Error message

ObjectName validation failed {}

What it means

AgentContextOptionBuilder.build validates the JMX ObjectName built from agent options; an ObjectNameValidationFailedException (invalid agentId/applicationName characters, etc.) is logged as 'ObjectName validation failed <agentIdType>' and rethrown. Agent startup proceeds no further with the context options until a valid ObjectName can be formed.

Solutions

  1. Fix agentId/applicationName in pinpoint.config: use only [a-zA-Z0-9._-], max 24 chars, and avoid ObjectName-reserved characters (,=:*?")
  2. Check e.getAgentIdType() in the log to see which field failed and correct that specific property
  3. Re-validate with ObjectName.checkValidity mentally: quote special chars or simplify the value
  4. Restart the agent after correcting pinpoint.config

Example fix

// before (pinpoint.config)
profiler.applicationname=My App:Prod
profiler.agentid=agent 01
// after
profiler.applicationname=MyApp-Prod
profiler.agentid=agent-01
Defensive patterns

Strategy: validation

Validate before calling

// validate config values before agent start
Pattern ok = Pattern.compile("^[a-zA-Z0-9._-]{1,24}$");
if (!ok.matcher(applicationName).matches() || !ok.matcher(agentId).matches())
    throw new IllegalArgumentException("agentId/applicationName contain invalid characters");

Type guard

boolean isValidPinpointId(String s) {
  return s != null && s.matches("^[a-zA-Z0-9._-]{1,24}$")
      && !s.matches(".*[,=:*?\"].*");
}

Try / catch

try { return builder.build(agentOption, profilerConfig); }
catch (ObjectNameValidationFailedException e) { logger.warn("ObjectName validation failed {}", e.getAgentIdType(), e); throw e; }

Prevention

When it happens

Trigger: Calling build() with an AgentOption/ProfilerConfig whose agentId, applicationName, agentName, or serviceType produce an ObjectName that fails javax.management.ObjectName syntax or Pinpoint's validation rules.

Common situations: pinpoint.config containing agentId or applicationName with illegal characters (spaces, commas, colons, quotes, wildcards *, ?, =) or values that are too long; localization mistakes in config files.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentContextOptionBuilder.java:31

                                           ObjectName objectName,
                                           ProfilerConfig profilerConfig) {
        return new DefaultAgentContextOption(
                agentOption.getInstrumentation(),
                objectName,
                profilerConfig,
                agentOption.getAgentPath(),
                agentOption.getPluginJars(),
                agentOption.getBootstrapJarPaths(),
                agentOption.isStaticResourceCleanup());
    }

    public AgentContextOption build(AgentOption agentOption, ProfilerConfig profilerConfig) {
        try {
            ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder();
            ObjectName objectName = objectNameBuilder.build(agentOption, profilerConfig);
            return build(agentOption, objectName, profilerConfig);
        } catch (ObjectNameValidationFailedException e) {
            logger.warn("ObjectName validation failed {}", e.getAgentIdType(), e);
            throw e;
        }

    }

}

View on GitHub (pinned to 744c3d3075)