使用Phoenix驱动程序我正在连接HBase。一切正常,但在获取连接时日志中存在错误堆栈跟踪。再次,它工作正常,功能上没有问题。
DataSource dataSource = getDataSource();
TransactionFactory transactionFactory = new JdbcTransactionFactory();
Environment environment = new Environment("test", transactionFactory, dataSource);
Configuration configuration = new Configuration(environment);
configuration.addMappers("co.mybatis.mapper");
return new SqlSessionFactoryBuilder().build(configuration);
public static DataSource getDataSource() {
return new UnpooledDataSource("org.apache.phoenix.jdbc.PhoenixDriver", CDH_UAT, "", "") {
@Override
public Connection getConnection() throws SQLException {
Connection connection = super.getConnection();// i see error stacktrace here
connection.setSchema("xxx");
return connection;
}
}}
java.util.concurrent.ExecutionException:org.apache.hadoop.hbase.security.AccessDeniedException:org.apache.hadoop.hbase.security.AccessDeniedException:权限不足(user=userid@mydomain.COM,cope = SYSTEM, PARAMS = [名称空间= SYSTEM,表= SYSTEM:CATALOG],动作= CREATE)
这是第一次打印错误堆栈跟踪,但之后一切看起来都不错。在获取连接时,它似乎第一次尝试插入系统目录表,不确定原因。
如何摆脱此错误?