Phoenix connection issues


I am developing a node to access Phoenix tables and retrieve some data. I could successfully do this in the basic level. However, I added more jars so I can use UDF (User Defined Function) in Phoenix. The UDF functions works locally without any issue. I wanted to include the UDF in my development node so I can use it from Knime. I have added the required jars (as I did locally) in the plugin.xml (runtime). However, when I execute the developed node I got those errors:

First execute:  

Execute failed: ("ExceptionInInitializerError"): null

And then when I immediately execute the node again I get this error:

Execute failed: Could not initialize class org.apache.phoenix.jdbc.PhoenixDriver

this is the connection code which works locally:

Connection conn = null;
        try {
            Properties props = new Properties();
            props.setProperty("phoenix.functions.allowUserDefinedFunctions", "true");


            conn = DriverManager.getConnection("jdbc:***", props);

        } catch (Exception e) {
            // LOGGER.error("error occurs "+ e.getMessage());

Since it works locally fine and I added all required jars in the plugin.xml why it doesn’t work.
Any ideas how I can solve this issue?



Something bad happens when the class org.apache.phoenix.jdbc.PhoenixDriver is being initialized. The reason should be part of the full stack trace. You can also debug the class loading and find the cause.

This is the full stack which as I said locally have no issue:

ERROR Phoenix_udf          0:1        Execute failed: ("ExceptionInInitializerError"): null
DEBUG Phoenix_udf          0:1        Execute failed: ("ExceptionInInitializerError"): null
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at xxx.Phoenix_udf.DatabaseConnection.connectPhoenix(
    at xxx.Phoenix_udf.Phoenix_udfNodeModel.execute(
    at org.knime.core.node.NodeModel.execute(
    at org.knime.core.node.NodeModel.executeModel(
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(
    at org.knime.core.node.Node.execute(
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(
    at org.knime.core.util.ThreadUtils$
    at java.util.concurrent.Executors$
    at org.knime.core.util.ThreadPool$
    at org.knime.core.util.ThreadPool$
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
    at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
    at org.apache.commons.logging.LogFactory.getLog(
    at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.<clinit>(



Why such error and only when I run from Knime?

'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.