Repository: camel
Updated Branches:
  refs/heads/camel-2.20.x a9a289d28 -> fd32e1cb8


CAMEL-11920: camel-hdfs2 not working in osgi using documented HdfsOsgiHelper


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

Branch: refs/heads/camel-2.20.x
Commit: 1da22b26cd67750dd6bcbea1d4e0ce762b3b5215
Parents: a9a289d
Author: Andrea Tarocchi <ataro...@redhat.com>
Authored: Tue Oct 17 19:11:40 2017 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Wed Oct 18 08:18:31 2017 +0200

----------------------------------------------------------------------
 components/camel-hdfs2/pom.xml                                 | 4 +++-
 .../java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java  | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1da22b26/components/camel-hdfs2/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-hdfs2/pom.xml b/components/camel-hdfs2/pom.xml
index 8bcee5a..dd53600 100644
--- a/components/camel-hdfs2/pom.xml
+++ b/components/camel-hdfs2/pom.xml
@@ -44,7 +44,9 @@
       org.apache.hadoop.hdfs.security.token.delegation,
       org.apache.hadoop.hdfs.protocol,
       org.apache.hadoop.hdfs.protocol.proto,
-      org.apache.hadoop.hdfs.protocol.datatransfer
+      org.apache.hadoop.hdfs.protocol.datatransfer,
+      org.apache.hadoop.net,
+      org.apache.hadoop.ipc
     </camel.osgi.import.additional>
     <camel.osgi.activator>
       org.apache.camel.component.hdfs2.osgi.HdfsActivator

http://git-wip-us.apache.org/repos/asf/camel/blob/1da22b26/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java
 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java
index 5077fbd..d63a592 100644
--- 
a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java
+++ 
b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java
@@ -41,13 +41,17 @@ public class HdfsOsgiHelper {
             // get bundle classloader for camel-hdfs2 bundle
             ClassLoader cl = getClass().getClassLoader();
             Configuration conf = new Configuration();
+            // set that as the hdfs configuration's classloader
+            conf.setClassLoader(cl);
             for (String key : fileSystems.keySet()) {
                 URI uri = URI.create(key);
                 conf.setClass(String.format("fs.%s.impl", uri.getScheme()), 
cl.loadClass(fileSystems.get(key)), FileSystem.class);
+                LOG.debug("Successfully loaded class: {}", 
fileSystems.get(key) );
                 FileSystem.get(uri, conf);
+                LOG.debug("Successfully got uri: {} from FileSystem Object", 
uri );
             }
         } catch (Exception e) {
-            LOG.debug(e.getMessage());
+            LOG.debug(e.getMessage(), e);
         }
     }
 

Reply via email to