{"record":{"id":"555a12ac015d45fa","repo":"baomidou/mybatis-plus","slug":"s-does-not-contain-value-for-s","errorCode":null,"errorMessage":"%s does not contain value for %s","messagePattern":"(.+?) does not contain value for (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisConfiguration.java","lineNumber":482,"sourceCode":"                    }\n                }\n            }\n            return super.put(key, value);\n        }\n\n        @Override\n        public boolean containsKey(Object key) {\n            if (key == null) {\n                return false;\n            }\n            return super.get(key) != null;\n        }\n\n        @Override\n        public V get(Object key) {\n            V value = super.get(key);\n            if (value == null) {\n                throw new IllegalArgumentException(name + \" does not contain value for \" + key);\n            }\n            if (useGeneratedShortKey && AMBIGUITY_INSTANCE == value) {\n                throw new IllegalArgumentException(key + \" is ambiguous in \" + name\n                    + \" (try using the full name including the namespace, or rename one of the entries)\");\n            }\n            return value;\n        }\n\n        private String getShortName(String key) {\n            final String[] keyParts = key.split(\"\\\\.\");\n            return keyParts[keyParts.length - 1];\n        }\n    }\n}\n","sourceCodeStart":464,"sourceCodeEnd":497,"githubUrl":"https://github.com/baomidou/mybatis-plus/blob/bf67d907478c724120bf76292da54abf9e73c2b3/mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisConfiguration.java#L464-L497","documentation":"Thrown by StrictMap.get when a lookup key maps to null. StrictMap deliberately fails fast on unknown statement/result-map/parameter-map ids instead of returning null, so typos in statement ids surface at configuration access time with the map name and the missing key in the message.","triggerScenarios":"Calling sqlSession.getMapper(...).someMethod() where the method's statement id was never registered (annotation missing and no XML statement); looking up a result map or sql fragment by an id that does not exist; using a statement id with a misspelled namespace or method name.","commonSituations":"Mapper interface method has no @Select/@Insert annotation and no matching XML statement; XML mapper file not listed in <mappers> or not in the mapper-locations scan path; renaming a Java method without updating the XML id; the MyBatis-Plus mapper-locations glob not matching the actual XML location.","solutions":["Verify the statement id in the error exists: check the mapper XML <select id=\"...\"> matches the interface method name exactly (case-sensitive).","Ensure the mapper XML is actually loaded: check mybatis-plus.mapper-locations (e.g. classpath*:mapper/**/*.xml) in application.yml, or the <mapper> entry in mybatis-config.xml.","If using pure annotation mappers, confirm the method has a statement annotation (@Select, @Insert, @Update, @Delete) or is a MyBatis-Plus BaseMapper inherited method.","Check the namespace attribute of the XML equals the fully-qualified interface name."],"exampleFix":"# before: mapper XML not scanned\nmybatis-plus:\n  mapper-locations: classpath:mapper/*.xml   # file actually in com/example/mapper/\n\n# after\nmybatis-plus:\n  mapper-locations: classpath*:**/mapper/*.xml","handlingStrategy":"validation","validationCode":"// verify a statement id is registered before use\nString id = \"com.example.UserMapper.selectById\";\nif (!factory.getConfiguration().hasStatement(id, false)) {\n    throw new IllegalStateException(\"Unknown statement: \" + id);\n}","typeGuard":null,"tryCatchPattern":"Catch IllegalArgumentException from StrictMap lookup only at configuration/diagnostic boundaries; log the missing key and fix the mapping — retrying is pointless because configuration is immutable.","preventionTips":["Keep mapper XML ids synchronized with interface method names (rename both together).","Verify mybatis-plus.mapper-locations patterns in a startup smoke test.","Prefer type-safe mapper interfaces (sqlSession.getMapper) over string statement lookups."],"tags":["mybatis","mybatis-plus","missing-mapping","configuration","mapper"],"backgroundTag":null,"analyzedSha":"bf67d907478c724120bf76292da54abf9e73c2b3","analyzedAt":"2026-08-14T15:17:09.543Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}