The class loader used by API exposed by hadoop and the context class loader used by RunJar(bin/hadoop jar phoenix-client.jar …. ) are different resulting in classes loaded from jar not visible to other current class loader used by API.
The actual problem is stated in the comment below https://issues.apache.org/jira/browse/PHOENIX-3495?focusedCommentId=15677081&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15677081
If we are not loading hbase classes from Hadoop classpath(from where hadoop jars are getting loaded), then the RemoteException will not get unwrapped because of ClassNotFoundException and the client will keep on retrying even if the cause of exception is DoNotRetryIOException.
RunJar#main() context class loader.
API(using current class loader).
We can create our own HBaseRemoteWithExtrasException(extension of RemoteWithExtrasException) so that default class loader will be the one from where the hbase classes are loaded and extend unwrapRemoteException() to throw exception if the unwrapping doesn’t take place because of CNF exception?