{"record":{"id":"493743a291ece89a","repo":"pinpoint-apm/pinpoint","slug":"not-found-new-method-classinternalname-metho","errorCode":null,"errorMessage":"not found new method. ${classInternalName}.${methodName}","messagePattern":"not found new method\\. (.+?)\\.(.+?)","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMAspectWeaver.java","lineNumber":135,"sourceCode":"                throw new InstrumentException(\"Signature miss match. method=\" + pointCutMethodNode.getName() + \", source=\" + sourceMethodNode.getDesc() + \", advice=\" + pointCutMethodNode.getDesc());\n            }\n\n            if (logger.isInfoEnabled()) {\n                logger.info(\"weaving method={}{}\", sourceMethodNode.getName(), sourceMethodNode.getDesc());\n            }\n\n            // rename.\n            final String methodName = this.methodNameReplacer.replaceMethodName(sourceMethodNode.getName());\n            sourceMethodNode.rename(methodName);\n            // set private.\n            sourceMethodNode.setAccess(sourceMethodNode.getAccess() & -6 | Opcodes.ACC_PRIVATE);\n            // copy.\n            classNode.copyMethod(pointCutMethodNode);\n\n            // remap\n            final ASMMethodNodeAdapter newMethodNode = classNode.getDeclaredMethod(pointCutMethodNode.getName(), pointCutMethodNode.getDesc());\n            if (newMethodNode == null) {\n                throw new InstrumentException(\"not found new method. \" + classNode.getInternalName() + \".\" + pointCutMethodNode.getName());\n            }\n            remapBuilder.setName(methodName);\n            ASMMethodInsnNodeRemapper remapper = remapBuilder.build();\n            newMethodNode.remapMethodInsnNode(remapper);\n        }\n    }\n\n    private static class MethodNodes {\n        public final List<ASMMethodNodeAdapter> pointCuts = new ArrayList<>();\n        public final List<ASMMethodNodeAdapter> jointPoints = new ArrayList<>();\n        public final List<ASMMethodNodeAdapter> utils = new ArrayList<>();\n    }\n}","sourceCodeStart":117,"sourceCodeEnd":148,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMAspectWeaver.java#L117-L148","documentation":"After copying a pointcut method into the source class, copyPointCutMethods() retrieves the newly copied method node to apply method-instruction remapping (renaming internal join point calls). If getDeclaredMethod returns null right after the copy, the copy silently failed — an internal invariant violation — so InstrumentException is thrown.","triggerScenarios":"classNode.copyMethod(pointCutMethodNode) did not actually add the method (e.g. duplicate method name+desc conflict or ASM copy failure), leaving no new node to remap.","commonSituations":"Advice declares a pointcut method identical to one already present in the source class; exotic class file versions/features that the ASM copy path mishandles.","solutions":["Check for a pre-existing method with the same name+descriptor in the source class before copying","Verify the ASM library version supports the target class file version","Enable debug logging around copyMethod to see why the copy failed","Report as a bug if copyMethod returns success but the node is absent"],"exampleFix":"// before\nclassNode.copyMethod(pointCutMethodNode);\nfinal ASMMethodNodeAdapter newMethodNode = classNode.getDeclaredMethod(pointCutMethodNode.getName(), pointCutMethodNode.getDesc());\n// after\nif (classNode.getDeclaredMethod(pointCutMethodNode.getName(), pointCutMethodNode.getDesc()) != null) {\n    throw new IllegalStateException(\"duplicate pointcut method: \" + pointCutMethodNode.getName());\n}\nclassNode.copyMethod(pointCutMethodNode);\nfinal ASMMethodNodeAdapter newMethodNode = classNode.getDeclaredMethod(pointCutMethodNode.getName(), pointCutMethodNode.getDesc());","handlingStrategy":"try-catch","validationCode":"if (sourceClassNode.getDeclaredMethod(pointCutMethodNode.getName(), pointCutMethodNode.getDesc()) != null) { throw new IllegalStateException(\"duplicate pointcut before copy\"); }","typeGuard":null,"tryCatchPattern":"try { weaver.weaving(src, adv); } catch (InstrumentException e) { if (e.getMessage().startsWith(\"not found new method.\")) { logger.error(\"copyMethod silently failed — check duplicates and ASM version\"); } }","preventionTips":["Detect duplicate methods before copying","Keep ASM library compatible with target class file versions","Report persistent copy failures as Pinpoint bugs"],"tags":["java","bytecode","asm","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}