Repository: camel Updated Branches: refs/heads/master 52fbc6b5d -> f3688e041
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/818d5485 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/818d5485 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/818d5485 Branch: refs/heads/master Commit: 818d54854dc54b7a8ca8cc0b2531d9893aac5c7b Parents: 52fbc6b 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:14:37 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/818d5485/components/camel-hdfs2/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-hdfs2/pom.xml b/components/camel-hdfs2/pom.xml index cd19368..f78769c 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/818d5485/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); } }