{"record":{"id":"669b077455636109","repo":"prestodb/presto","slug":"not-found-669b07","errorCode":"NOT_FOUND","errorMessage":"Failed to factory serializer class.  Is it on the classpath?","messagePattern":"Failed to factory serializer class\\.  Is it on the classpath\\?","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java","lineNumber":82,"sourceCode":"            Connector connector,\n            ConnectorSession session,\n            AccumuloSplit split,\n            String username,\n            List<AccumuloColumnHandle> columnHandles)\n    {\n        requireNonNull(session, \"session is null\");\n        requireNonNull(split, \"split is null\");\n        requireNonNull(username, \"username is null\");\n        constraints = requireNonNull(split.getConstraints(), \"constraints is null\");\n\n        rowIdName = split.getRowId();\n\n        // Factory the serializer based on the split configuration\n        try {\n            this.serializer = split.getSerializerClass().getConstructor().newInstance();\n        }\n        catch (Exception e) {\n            throw new PrestoException(NOT_FOUND, \"Failed to factory serializer class.  Is it on the classpath?\", e);\n        }\n\n        // Save off the column handles and create a list of the Accumulo types\n        this.columnHandles = requireNonNull(columnHandles, \"column handles is null\");\n        ImmutableList.Builder<Type> types = ImmutableList.builder();\n        for (AccumuloColumnHandle column : columnHandles) {\n            types.add(column.getType());\n        }\n        this.columnTypes = types.build();\n\n        try {\n            // Create the BatchScanner and set the ranges from the split\n            scanner = connector.createBatchScanner(split.getFullTableName(), getScanAuthorizations(session, split, connector, username), 10);\n            scanner.setRanges(split.getRanges());\n        }\n        catch (Exception e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, format(\"Failed to create batch scanner for table %s\", split.getFullTableName()), e);\n        }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java#L64-L100","documentation":"AccumuloRecordSet's constructor reflectively instantiates the AccumuloRowSerializer class named in the split configuration via Class.getConstructor().newInstance(). Any reflective failure (class missing, instantiation error, no no-arg constructor) is wrapped as NOT_FOUND with this message. It almost always means the serializer class is not on the Presto classpath or cannot be constructed.","triggerScenarios":"Creating an AccumuloRecordSet for a split whose getSerializerClass() names a class absent from the classpath, an abstract class, a class without a public no-arg constructor, or whose constructor throws.","commonSituations":"Custom serializer plugin JAR not deployed to the coordinator/workers' plugin directory; class name typo in table metadata; serializer class compiled against a different Presto/connector version and failing to initialize; non-public default constructor.","solutions":["Deploy the JAR containing the serializer class to the presto-accumulo plugin directory on every node and restart Presto","Verify the fully-qualified serializer class name stored in the table metadata is correct","Ensure the class is public with a public no-arg constructor (implement AccumuloRowSerializer)","Check worker logs for the wrapped cause to distinguish ClassNotFound vs instantiation failures"],"exampleFix":"// before\npublic class MySerializer {\n    MySerializer() {}\n}\n// after\npublic class MySerializer extends AccumuloRowSerializer {\n    public MySerializer() {}\n}","handlingStrategy":"validation","validationCode":"String cls = split.getSerializerClass().getName();\ntry {\n    Class.forName(cls);\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Serializer class not on classpath: \" + cls);\n}","typeGuard":"boolean isInstantiableSerializer(String name) {\n    try {\n        Class<?> c = Class.forName(name);\n        return AccumuloRowSerializer.class.isAssignableFrom(c)\n            && java.lang.reflect.Modifier.isPublic(c.getModifiers())\n            && Arrays.stream(c.getConstructors()).anyMatch(ctor -> ctor.getParameterCount() == 0);\n    } catch (ClassNotFoundException e) { return false; }\n}","tryCatchPattern":"try {\n    // query / create record set\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NOT_FOUND\") && e.getMessage().contains(\"Failed to factory serializer\")) {\n        // redeploy serializer JAR to plugin dir, fix class name, retry\n    }\n    throw e;\n}","preventionTips":["Ship the serializer JAR inside the presto-accumulo plugin directory on every node","Use the fully-qualified class name exactly as packaged; verify with jar tf","Always give serializers a public no-arg constructor","Smoke-test table creation + a SELECT after any serializer or version change"],"tags":["accumulo","classpath","reflection","serialization"],"backgroundTag":"class-not-found-on-classpath","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}