{"record":{"id":"dc86720c67e29e29","repo":"pinpoint-apm/pinpoint","slug":"too-many","errorCode":null,"errorMessage":"too many ","messagePattern":"too many ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/BootDir.java","lineNumber":81,"sourceCode":"        return resolvedJarList;\n    }\n\n    private Path find(List<Path> jarFiles, final JarDescription jarDescription) {\n        final String jarName = jarDescription.getJarName();\n        final Pattern pattern = jarDescription.getVersionPattern();\n\n        final List<Path> jarPathList = findFileByPattern(jarFiles, pattern);\n        if (jarPathList.isEmpty()) {\n            logger.info(jarName + \" not found.\");\n            return null;\n        }\n        if (jarPathList.size() == 1) {\n            final Path file = jarPathList.get(0);\n            logger.info(\"boot path:\" + FileUtils.subpathAfterLast(file, 2));\n            return FileUtils.toRealPath(file);\n        }\n\n        logger.warn(\"too many \" + jarName + \" found. \" + jarPathList);\n        return null;\n    }\n\n    private List<Path> findFileByPattern(List<Path> jarFiles, Pattern pattern) {\n        List<Path> findList = new ArrayList<>();\n        for (Path jarFile : jarFiles) {\n            final Path fileName = jarFile.getFileName();\n            if (fileName != null) {\n                Matcher matcher = pattern.matcher(fileName.toString());\n                if (matcher.matches()) {\n                    findList.add(jarFile);\n                }\n            }\n        }\n        return findList;\n    }\n\n    public List<Path> getJarPath() {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/agentdir/BootDir.java#L63-L99","documentation":"BootDir.find() locates a specific boot jar (e.g. javassist.jar) by pattern match inside the agent boot directory. When more than one file matches the pattern, it logs 'too many <jarName> found' and returns null, meaning the boot jar path could not be resolved unambiguously.","triggerScenarios":"Agent boot directory contains two or more JARs whose names match the same pattern (e.g. javassist-3.x.jar and javassist-3.y.jar left behind by an upgrade).","commonSituations":"Upgrading Pinpoint by overwriting the new distribution onto an old one without cleaning boot/; manually dropping a different version of a library into the boot dir; backup copies like javassist.jar.bak or javassist-old.jar present.","solutions":["Inspect the boot directory and remove older/duplicate JARs matching the reported name","Clean-install the agent distribution instead of overlaying upgrades","Keep exactly one version of each library in the boot directory","Move stale jars to a backup directory outside the agent tree"],"exampleFix":"// before\nls boot/\n  javassist-3.29.2-ga.jar  javassist-3.23.1-ga.jar\n// after\nrm boot/javassist-3.23.1-ga.jar\nls boot/\n  javassist-3.29.2-ga.jar","handlingStrategy":"validation","validationCode":"try (java.util.stream.Stream<Path> s = java.nio.Files.list(Paths.get(agentHome, \"boot\"))) { long n = s.filter(f -> f.getFileName().toString().startsWith(\"javassist\")).count(); if (n > 1) throw new IllegalStateException(\"duplicate boot jars: \" + n); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clean-install agent distributions instead of overlaying upgrades","Keep exactly one version of each library in boot/","Remove .bak/.old/backup jars from the agent directory","Automate upgrade as: delete old dir, extract new dir, reapply config"],"tags":["agent","classpath","duplicate-jars","upgrade","logging"],"backgroundTag":"ambiguous-classpath-entry","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"}