{"record":{"id":"1528c813a9ae01fe","repo":"alibaba/DataX","slug":"faild-load-org-apache-phoenix-jdbc-phoenixdriver","errorCode":null,"errorMessage":"faild load org.apache.phoenix.jdbc.PhoenixDriver","messagePattern":"faild load org\\.apache\\.phoenix\\.jdbc\\.PhoenixDriver","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"hbase11xsqlreader/src/main/java/com/alibaba/datax/plugin/reader/hbase11xsqlreader/HbaseSQLHelper.java","lineNumber":39,"sourceCode":"import org.apache.phoenix.schema.SaltingUtil;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.util.*;\n\n\npublic class HbaseSQLHelper {\n    private static final Logger LOG = LoggerFactory.getLogger(HbaseSQLHelper.class);\n\n    static {\n        try {\n            Class.forName(\"org.apache.phoenix.jdbc.PhoenixDriver\");\n        } catch (Throwable t) {\n            throw new RuntimeException(\"faild load org.apache.phoenix.jdbc.PhoenixDriver\", t);\n        }\n    }\n\n    public static org.apache.hadoop.conf.Configuration generatePhoenixConf(HbaseSQLReaderConfig readerConfig) {\n        org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration();\n\n        String table = readerConfig.getTableName();\n        List<String> columns = readerConfig.getColumns();\n        String zkUrl = readerConfig.getZkUrl();\n\n        PhoenixConfigurationUtil.setInputClass(conf, PhoenixRecordWritable.class);\n\n        PhoenixConfigurationUtil.setInputTableName(conf, readerConfig.getSchema()+\".\"+table);\n\n        if (!columns.isEmpty()) {\n            PhoenixConfigurationUtil.setSelectColumnNames(conf, columns.toArray(new String[columns.size()]));\n        }\n        if(Objects.nonNull(readerConfig.getWhere())){","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/hbase11xsqlreader/src/main/java/com/alibaba/datax/plugin/reader/hbase11xsqlreader/HbaseSQLHelper.java#L21-L57","documentation":"RuntimeException (with cause) from a static initializer in HbaseSQLHelper: Class.forName(\"org.apache.phoenix.jdbc.PhoenixDriver\") threw — classloading failure for the Phoenix JDBC driver. Because it is a static-init failure, the exception surfaces as ExceptionInInitializerError on first use of the class and the class is then unusable for the rest of the JVM run.","triggerScenarios":"First access to any HbaseSQLHelper member when org.apache.phoenix.jdbc.PhoenixDriver cannot be loaded: phoenix jar absent from the hbase11xsqlreader plugin's classpath, or present but its transitive dependencies (HBase/Hadoop/guava etc.) conflict with the versions bundled in DataX's lib directory.","commonSituations":"Deploying the plugin without putting the matching phoenix-client jar into the plugin dir; mixing Phoenix 4.x client with an incompatible HBase/Hadoop version on DataX's shared lib; jar corrupted or truncated during upload; running on a JDK whose classloader blocks the driver.","solutions":["Check the Throwable cause in the stack trace (NoClassDefFoundError names the missing class).","Add the phoenix-client jar matching your HBase cluster version into hbase11xsqlreader/libs (plugin-local classloader).","Resolve dependency conflicts: keep DataX core libs on the shared classpath and Phoenix/HBase deps inside the plugin directory.","Re-download/verify the jar if corrupted (jar tf phoenix-*.jar)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"try {\n    Class.forName(\"org.apache.phoenix.jdbc.PhoenixDriver\");\n} catch (Throwable t) {\n    throw new IllegalStateException(\"Phoenix client jar missing/incompatible in hbase11xsqlreader libs: \" + t);\n}","typeGuard":null,"tryCatchPattern":"try {\n    HbaseSQLHelper.init(...);\n} catch (ExceptionInInitializerError e) {\n    // static init already failed once; report classpath problem and restart JVM after fixing jars\n}","preventionTips":["Ship the phoenix-client jar matching the server version inside the plugin directory.","Smoke-test driver loading in CI with the exact plugin classpath layout.","Remember a failed static initializer poisons the class for the whole JVM — fix jars and restart rather than retrying."],"tags":["phoenix","hbase","datax","classpath","classloading"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}