DRILL-5702: Jdbc Driver Class not found

1. Setting "package.namespace.prefix" to "oadd." by default for all profiles. 
It can be overridden if necessary within any profile.
2. Removing duplicated and redundant excluding of commons-logging packages.

closes #1063


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/c7872dc0
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/c7872dc0
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/c7872dc0

Branch: refs/heads/master
Commit: c7872dc00fd320133a7ce8b80c31a9a681fbd700
Parents: ed089d7
Author: Vitalii Diravka <vitalii.dira...@gmail.com>
Authored: Wed Dec 6 17:31:10 2017 +0200
Committer: Arina Ielchiieva <arina.yelchiy...@gmail.com>
Committed: Sat Dec 9 15:49:24 2017 +0200

----------------------------------------------------------------------
 .../exec/rpc/security/SecurityConfiguration.java   |  5 ++---
 exec/jdbc-all/pom.xml                              | 17 +++++++----------
 pom.xml                                            |  8 --------
 3 files changed, 9 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/c7872dc0/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
index 275fd84..ca90332 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/security/SecurityConfiguration.java
@@ -54,14 +54,13 @@ public class SecurityConfiguration extends Configuration {
    * Update the GroupMapping class name to add namespace prefix retrieved from 
System Property. This is needed since
    * in drill-jdbc-all jar we are packaging hadoop dependencies under that 
namespace. This will help application
    * using this jar as driver to avoid conflict with it's own hadoop 
dependency if any. The property is needed only
-   * when Hadoop classes are relocated to different namespace which is done 
inside jdbc-all package. For normal build
-   * this property is not required as Hadoop classes will be used normally.
+   * when Hadoop classes are relocated to different namespace which is done 
inside jdbc-all package.
    */
   private void updateGroupMapping() {
     final String originalClassName = 
get(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING);
     final String profilePrefix = 
System.getProperty("drill.security.namespacePrefix");
 
-    if (!Strings.isNullOrEmpty(profilePrefix)) {
+    if (originalClassName != null && !Strings.isNullOrEmpty(profilePrefix) && 
!originalClassName.startsWith(profilePrefix)) {
       set(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING, profilePrefix 
+ originalClassName);
     }
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/c7872dc0/exec/jdbc-all/pom.xml
----------------------------------------------------------------------
diff --git a/exec/jdbc-all/pom.xml b/exec/jdbc-all/pom.xml
index 68130e1..d0e9001 100644
--- a/exec/jdbc-all/pom.xml
+++ b/exec/jdbc-all/pom.xml
@@ -26,6 +26,12 @@
   <artifactId>drill-jdbc-all</artifactId>
   <name>JDBC JAR with all dependencies</name>
 
+  <!-- Since we are packaging hadoop dependencies under the namespace with 
"oadd." prefix by default,
+       "package.namespace.prefix" equals to "oadd.". It can be overridden if 
necessary within any profile -->
+  <properties>
+    <package.namespace.prefix>oadd.</package.namespace.prefix>
+  </properties>
+
   <dependencies>
 
     <dependency>
@@ -535,19 +541,10 @@
   </pluginRepositories>
 
   <profiles>
-    <profile>
-      <id>default</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <properties>
-        <package.namespace.prefix>oadd.</package.namespace.prefix>
-      </properties>
-    </profile>
       <profile>
         <id>mapr</id>
         <properties>
-          <package.namespace.prefix></package.namespace.prefix>
+          <package.namespace.prefix />
         </properties>
 
         <build>

http://git-wip-us.apache.org/repos/asf/drill/blob/c7872dc0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e3387e6..35a8826 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1918,10 +1918,6 @@
                 <groupId>commons-logging</groupId>
               </exclusion>
               <exclusion>
-                <artifactId>commons-logging</artifactId>
-                <groupId>commons-logging</groupId>
-              </exclusion>
-              <exclusion>
                 <artifactId>core</artifactId>
                 <groupId>org.eclipse.jdt</groupId>
               </exclusion>
@@ -2005,10 +2001,6 @@
                 <groupId>commons-logging</groupId>
               </exclusion>
               <exclusion>
-                <artifactId>commons-logging</artifactId>
-                <groupId>commons-logging</groupId>
-              </exclusion>
-              <exclusion>
                 <groupId>com.sun.jersey</groupId>
                 <artifactId>jersey-core</artifactId>
               </exclusion>

Reply via email to