{"record":{"id":"07cfc757f3d41864","repo":"alibaba/canal","slug":"error-when-load-extension-class-interface-cla","errorCode":null,"errorMessage":"Error when load extension class(interface: {}, class line: {}), class {}is not subtype of interface.","messagePattern":"Error when load extension class\\(interface: (.+?), class line: (.+?)\\), class (.+?)is not subtype of interface\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/ExtensionLoader.java","lineNumber":341,"sourceCode":"                            while ((line = reader.readLine()) != null) {\n                                final int ci = line.indexOf('#');\n                                if (ci >= 0) line = line.substring(0, ci);\n                                line = line.trim();\n                                if (line.length() > 0) {\n                                    try {\n                                        String name = null;\n                                        int i = line.indexOf('=');\n                                        if (i > 0) {\n                                            name = line.substring(0, i).trim();\n                                            line = line.substring(i + 1).trim();\n                                        }\n                                        if (line.length() > 0) {\n                                            Class<?> clazz = classLoader.loadClass(line);\n                                            // Class<?> clazz =\n                                            // Class.forName(line, true,\n                                            // classLoader);\n                                            if (!type.isAssignableFrom(clazz)) {\n                                                throw new IllegalStateException(\n                                                        \"Error when load extension class(interface: \" + type\n                                                                + \", class line: \" + clazz.getName()\n                                                                + \"), class \" + clazz.getName()\n                                                                + \"is not subtype of interface.\");\n                                            } else {\n                                                try {\n                                                    clazz.getConstructor(type);\n                                                } catch (NoSuchMethodException e) {\n                                                    clazz.getConstructor();\n                                                    String[] names = NAME_SEPARATOR.split(name);\n                                                    if (names != null && names.length > 0) {\n                                                        for (String n : names) {\n                                                            if (!cachedNames.containsKey(clazz)) {\n                                                                cachedNames.put(clazz, n);\n                                                            }\n                                                            Class<?> c = extensionClasses.get(n);\n                                                            if (c == null) {\n                                                                extensionClasses.put(n, clazz);","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/ExtensionLoader.java#L323-L359","documentation":"Error \"Error when load extension class(interface: {}, class line: {}), class {}is not subtype of interface.\" thrown in alibaba/canal.","triggerScenarios":"Thrown at client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/ExtensionLoader.java:341 when the library encounters an invalid state.","commonSituations":"Extension class does not implement its SPI interface. Validate assignability before registration and skip the offending line with a clear message naming file and class.","solutions":["Make the extension class implement the declared extension interface.","Fix the SPI resource file entry so the listed class matches the expected interface."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}