Fix HBase integration (asasvari, gezapeti)
diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java b/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
index 307f565..2f7092c 100644
--- a/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
+++ b/core/src/main/java/org/apache/oozie/action/hadoop/HbaseCredentials.java
@@ -44,7 +44,12 @@
  *
  */
 public class HbaseCredentials extends Credentials {
+    static final String OOZIE_HBASE_CLIENT_SITE_XML = "oozie-hbase-client-site.xml";
+    static final String HBASE_USE_DYNAMIC_JARS = "hbase.dynamic.jars.dir";
 
+    static {
+        Configuration.addDefaultResource(OOZIE_HBASE_CLIENT_SITE_XML);
+    }
 
     /* (non-Javadoc)
      * @see org.apache.oozie.action.hadoop.Credentials#addtoJobConf(org.apache.hadoop.mapred.JobConf, org.apache.oozie.action.hadoop.CredentialsProperties, org.apache.oozie.action.ActionExecutor.Context)
diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
index 50577fd..7d957bc 100644
--- a/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
+++ b/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
@@ -1135,6 +1135,9 @@
 
             JobConf launcherJobConf = createLauncherConf(actionFs, context, action, actionXml, actionConf);
 
+            removeHBaseSettingFromOozieDefaultResource(launcherJobConf);
+            removeHBaseSettingFromOozieDefaultResource(actionConf);
+
             LOG.debug("Creating Job Client for action " + action.getId());
             jobClient = createJobClient(context, launcherJobConf);
             String launcherId = LauncherMapperHelper.getRecoveryId(launcherJobConf, context.getActionDir(), context
@@ -1216,6 +1219,17 @@
             }
         }
     }
+
+    private void removeHBaseSettingFromOozieDefaultResource(final Configuration jobConf) {
+        final String[] propertySources = jobConf.getPropertySources(HbaseCredentials.HBASE_USE_DYNAMIC_JARS);
+        if (propertySources != null && propertySources.length > 0 &&
+                propertySources[0].contains(HbaseCredentials.OOZIE_HBASE_CLIENT_SITE_XML)) {
+            jobConf.unset(HbaseCredentials.HBASE_USE_DYNAMIC_JARS);
+            LOG.debug(String.format("Unset [%s] inserted from default Oozie resource XML [%s]",
+                    HbaseCredentials.HBASE_USE_DYNAMIC_JARS, HbaseCredentials.OOZIE_HBASE_CLIENT_SITE_XML));
+        }
+    }
+
     private boolean needInjectCredentials() {
         boolean methodExists = true;
 
diff --git a/core/src/main/resources/oozie-hbase-client-site.xml b/core/src/main/resources/oozie-hbase-client-site.xml
new file mode 100644
index 0000000..cc67f9e
--- /dev/null
+++ b/core/src/main/resources/oozie-hbase-client-site.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<configuration>
+    <property>
+        <name>hbase.use.dynamic.jars</name>
+        <value>false</value>
+    </property>
+</configuration>