{"record":{"id":"4c2d9a0b5d18cb5c","repo":"pinpoint-apm/pinpoint","slug":"failed-to-add-field-with-accessor-accessorclass","errorCode":null,"errorMessage":"Failed to add field with accessor [${accessorClassName}]. Cause:${e.getMessage()}","messagePattern":"Failed to add field with accessor \\[(.+?)\\]\\. Cause:(.+?)","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":289,"sourceCode":"            final String accessorTypeName = accessorClass.getName();\n            final String fieldName = FIELD_PREFIX + JavaAssistUtils.javaClassNameToVariableName(accessorTypeName);\n            // skip members already declared in this class. e.g. a CGLIB proxy copies the injected members of an instrumented class\n            boolean modified = false;\n            ASMFieldNodeAdapter fieldNode = this.classNode.getDeclaredField(fieldName, type.getDescriptor());\n            if (fieldNode == null) {\n                fieldNode = this.classNode.addField(fieldName, type.getDescriptor());\n                modified = true;\n            }\n            modified |= this.classNode.addInterface(accessorTypeName);\n            modified |= this.classNode.addGetterMethod(accessorDetails.getGetter().getName(), fieldNode);\n            modified |= this.classNode.addSetterMethod(accessorDetails.getSetter().getName(), fieldNode);\n            if (modified) {\n                setModified(true);\n            } else if (logger.isDebugEnabled()) {\n                logger.debug(\"Skip addField, accessor already declared. class={}, accessor={}\", getName(), accessorTypeName);\n            }\n        } catch (Exception e) {\n            throw new InstrumentException(\"Failed to add field with accessor [\" + accessorClass.getName() + \"]. Cause:\" + e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public void addGetter(Class<?> getterClass, String fieldName) throws InstrumentException {\n        Objects.requireNonNull(getterClass, \"getterClass\");\n        Objects.requireNonNull(fieldName, \"fieldName\");\n\n        try {\n            final GetterAnalyzer.GetterDetails getterDetails = GetterAnalyzer.instance().analyze(getterClass);\n            final ASMFieldNodeAdapter fieldNode = this.classNode.getField(fieldName, null);\n            if (fieldNode == null) {\n                throw new IllegalArgumentException(\"Not found field. name=\" + fieldName);\n            }\n            Type fieldType = getterDetails.getFieldType();\n            if (!fieldNode.getJavaType().equals(fieldType)) {\n                throw new IllegalArgumentException(\"different return type. return=\" + fieldType + \", field=\" + fieldNode.getJavaType());\n            }","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L271-L307","documentation":"Catch-all guard in ASMClass.addField(accessor): an unexpected exception occurred while injecting the accessor-backed field into the class bytecode; the message prefixes the accessor class name and chains the underlying cause.","triggerScenarios":"Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the chained cause message for the real bytecode-generation failure","Verify the accessor type class is loadable and valid","Check for duplicate field injection on classes like CGLIB proxies (already handled — confirm not hitting a variant)","Upgrade the profiler if hitting a known instrumentation bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}