{"record":{"id":"3759cdc72f4f3462","repo":"pinpoint-apm/pinpoint","slug":"objectname-validation-failed","errorCode":null,"errorMessage":"ObjectName validation failed {}","messagePattern":"ObjectName validation failed (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentContextOptionBuilder.java","lineNumber":31,"sourceCode":"                                           ObjectName objectName,\n                                           ProfilerConfig profilerConfig) {\n        return new DefaultAgentContextOption(\n                agentOption.getInstrumentation(),\n                objectName,\n                profilerConfig,\n                agentOption.getAgentPath(),\n                agentOption.getPluginJars(),\n                agentOption.getBootstrapJarPaths(),\n                agentOption.isStaticResourceCleanup());\n    }\n\n    public AgentContextOption build(AgentOption agentOption, ProfilerConfig profilerConfig) {\n        try {\n            ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder();\n            ObjectName objectName = objectNameBuilder.build(agentOption, profilerConfig);\n            return build(agentOption, objectName, profilerConfig);\n        } catch (ObjectNameValidationFailedException e) {\n            logger.warn(\"ObjectName validation failed {}\", e.getAgentIdType(), e);\n            throw e;\n        }\n\n    }\n\n}\n","sourceCodeStart":13,"sourceCodeEnd":38,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentContextOptionBuilder.java#L13-L38","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Fix agentId/applicationName in pinpoint.config: use only [a-zA-Z0-9._-], max 24 chars, and avoid ObjectName-reserved characters (,=:*?\")","Check e.getAgentIdType() in the log to see which field failed and correct that specific property","Re-validate with ObjectName.checkValidity mentally: quote special chars or simplify the value","Restart the agent after correcting pinpoint.config"],"exampleFix":"// before (pinpoint.config)\nprofiler.applicationname=My App:Prod\nprofiler.agentid=agent 01\n// after\nprofiler.applicationname=MyApp-Prod\nprofiler.agentid=agent-01","handlingStrategy":"validation","validationCode":"// validate config values before agent start\nPattern ok = Pattern.compile(\"^[a-zA-Z0-9._-]{1,24}$\");\nif (!ok.matcher(applicationName).matches() || !ok.matcher(agentId).matches())\n    throw new IllegalArgumentException(\"agentId/applicationName contain invalid characters\");","typeGuard":"boolean isValidPinpointId(String s) {\n  return s != null && s.matches(\"^[a-zA-Z0-9._-]{1,24}$\")\n      && !s.matches(\".*[,=:*?\\\"].*\");\n}","tryCatchPattern":"try { return builder.build(agentOption, profilerConfig); }\ncatch (ObjectNameValidationFailedException e) { logger.warn(\"ObjectName validation failed {}\", e.getAgentIdType(), e); throw e; }","preventionTips":["Use only [a-zA-Z0-9._-] in agentId/applicationName, max 24 chars","Avoid JMX ObjectName reserved characters (, : = * ? \")","Validate pinpoint.config in CI before rollout"],"tags":["jmx","validation","configuration","objectname"],"backgroundTag":"invalid-identifier-format","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}