Question

We are trying to connect to an HBase server from a WebApp deployed to WebLogic 12c.

The WebApp uses a jar file which contains the HBase client connection code. This code connects to HBase through an instance of HTablePool, which is lazy-initialized as follows when the first request for an HTable is made:

public HTableInterface getTable(String tableName) {

    if (pool == null) {

        logger.info("Initializing connection to HBase");

        final Configuration config = HBaseConfiguration.create();

        config.set("hbase.zookeeper.quorum", "<HBaseHost>");

        pool = new HTablePool(config, Integer.MAX_VALUE);

        logger.info("HTable pool created");

    }

    return = pool.getTable(tableName);


}

This code works fine when being called from JUnit (ie without deploying it to WebLogic). But onces its deployed to WL and called from the WebApp, the following exception is thrown (note that Ive replaced all specific connection details by , , etc.

INFO: Initiating client connection, connectString=:2181 sessionTimeout=180000 watcher=hconnection 14-Jun-2013 17:28:06 org.apache.zookeeper.ClientCnxn$SendThread startConnect INFO: Opening socket connection to server /:2181 13/06/14 17:28:06 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 6504@ 14-Jun-2013 17:28:06 org.apache.zookeeper.ClientCnxn$SendThread run WARNING: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.lang.IllegalArgumentException: No Configuration was registered that can handle the configuration named Client at com.bea.common.security.jdkutils.JAASConfiguration.getAppConfigurationEntry(JAASConfiguration.java:130) at org.apache.zookeeper.client.ZooKeeperSaslClient.(ZooKeeperSaslClient.java:92) at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:938) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:973) 13/06/14 17:28:07 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossExce ption: KeeperErrorCode = ConnectionLoss for /hbase/master 13/06/14 17:28:07 INFO util.RetryCounter: Sleeping 2000ms before retry #1...

It looks like maybe we are missing some additional JAAS config to allow outgoing connections from WL?

Any help would be much appreciated.

Was it helpful?

Solution

OK so after some more Googling we found out that this is due to:

https://issues.apache.org/jira/browse/ZOOKEEPER-1696

An issue with the combination WebLogic / Zookeeper when not using SASL.

The Zookeeper Jira above links to a fix on the Zookeeper source, which unfortunately we can not use as we have to run with Cloudera CDH 4.2.2

Most likely we will switch to JBoss. At least JBoss 5 (the very lowest version we can run) does not show this issue. We will also try JBoss 6 & 7, see what happens then.

Will accept this as the answer, hopefully it will be useful for someone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top